-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add explicit refresh token callable. #1230 #1555
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Just some minor comments with discussion potential and one question:
What are potential performance implications?
Apps that will required this will need to call this with every outgoing request. This is IMHO ok for the internal channel to waved
. But I am not sure what TokenSource
implementation is effectively used so my concern is whether there is a potential of spamming the identity with a lot of token requests.
Good point. According to docs - TokenSource returns a TokenSource that returns t until t expires, automatically refreshing it as necessary using the provided context. which seems good to me, but feel free to correct me if I am missing something.
wdyt @zoido? |
Agree. Clicked trough it once again and got to the same conclusion. Thanks.
I don't think it's necessary for the explicit endpoint. Reasoning: you explicitly call something that can fail. If it fails you should be able to recover. But I do not see deep into the interaction between the app and waved so I cannot foresee all of the potential side-effects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🥗
Thanks.
Thanks for the review @zoido! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds
force_token_refresh
callable toq.auth
. Upon calling, theq.auth.access_token
is updated, and waved session is synced.Since this is server-to-server communication, no cookies are stored (in comparison to server-to-browser) so I had to keep the session ID in the app to make sure I could identify and sync the correct session during refresh. Open to better ideas/suggestions.
Open question: Shall we purge the session in case of an unsuccessful refresh attempt?
Closes #1230