(emailpassword & session - react - python-flask) s...
# support-questions-legacy
j
(emailpassword & session - react - python-flask) set and clear custom cookies on signin and signout
I'd like to set / clear custom cookies on signin and signout. The recommended approach to build a signin backend callback in python, doesn't appear to give access to a mutable response object. https://supertokens.com/docs/emailpassword/common-customizations/handling-signin-success#2-on-the-backend. Is there an approach I'm overlooking or a workaround for this?
r
Hey! You could write your own middleware and detect when these paths are called. And then mutate the response object however you’d like to
j
thanks! I was able to use flask's
after_request
hook to accomplish this. I matched on
request.path
r
nice!
2 Views