Replies: 4 comments 1 reply
-
I think you can achieve this by overloading the class MyCookieTransport(CookieTransport):
def _set_login_cookie(self, response: Response, token: str) -> Response:
response = super()._set_login_cookie(response, token)
response.set_cookie("is_authed", "true", httponly=False)
return response
def _set_logout_cookie(self, response: Response) -> Response:
response = super()._set_logout_cookie(response)
response.set_cookie("is_authed", "", httponly=False)
return response |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks I will try it out and let you know how it goes :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
I took it for a spin and the approach works nicely. Thanks :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Would you like me to document this in a PR? :) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
We are using the CookieTransport for our jwt's and it is working nicely. Is there a good way to set and remove a companion cookie that is not HTTPOnly that can be used by the frontend to validate if we actually have access to the credential cookie or not.
While we can track the state manually in the frontend it is very easy for it to diverge from the validity of the cookie (either expiration or if the logout calls fails for whatever reason).
Beta Was this translation helpful? Give feedback.
All reactions