Skip to content
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

Branch 'part 5-6', on page refresh token value set to the initial null #4

Open
keijop opened this issue Nov 24, 2021 · 1 comment
Open

Comments

@keijop
Copy link

keijop commented Nov 24, 2021

I followed the flow for declaring variable token with initial value null and then using the setToken function to reassign the value outside of the module when user logs in.
This flow breaks for me when I refresh the page. After refreshing the page my http server requests return 401 Unauthorized with 'invalid token'. It seems that refreshing page reloads the module and variable token is null again. Dev tools show Authorization header being set with value null.
Anybody else had the same problem? Is it my code or is the flow in the example broken?

@machy44
Copy link

machy44 commented Jan 6, 2022

I hope you find out what was happening in meantime. It seems to me like you didnt setToken from local storage when component is mounted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants