-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix refresh token flow #1235
Fix refresh token flow #1235
Conversation
Your Render PR Server URL is https://storage-ui-stage-pr-1235.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c3hne6c7o9q2usc8i3mg. |
Your Render PR Server URL is https://files-ui-stage-pr-1235.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c3hne6s7o9q2usc8i3v0. |
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.
Looks good, I had a look at the code, and I'm not sure I understand the withLocalStorage
altogether. If you recall what this is @FSM1 and let me know, I'd be happy to add some comments about it.
When the FilesApiContext was originally built, it was meant to be more generic component, and a flag could be passed in that would determine where the refresh token was stored (local or session). The real issue this ticket solves is that the initialize useEffect (which we really only want to run once) did not have the Since Files is only using session storage for the refresh token, I just removed the localStorage branch of the ternary. |
Closes #1224
Replace call to the session storage helper with direct browser Api calls to
sessionStorage.getItem()
inside the refresh token handler.