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

Question: Does this lib support page refresh? #4

Open
MikaelPorttila opened this issue Sep 10, 2020 · 1 comment
Open

Question: Does this lib support page refresh? #4

MikaelPorttila opened this issue Sep 10, 2020 · 1 comment

Comments

@MikaelPorttila
Copy link

Hi,
I'm trying out your lib and noticed that my auth state was gone once I reloaded the page but I still have a 'auth0.is.authenticated' cookie and should be logged in, do I need to do something after the page has been reloaded to reinit the auth-state or should I capture the state myself and handle it on the first onAuth-callback?

@rturnq
Copy link
Owner

rturnq commented Sep 10, 2020

Are you saying you are not authenticated when you reload or that appState is undefined? This lib does support page refreshes and ultimately the underlying auth0-spa package should handle that. If it is not, I can help troubleshoot. If it is the appState being undefined, looking over that again, it seems like it was a mistake for me to provide access to it like I did. It appears to be designed for preventing cross-site request forgery and only exists during the initial login and will always be undefined subsequently. I think I should just remove any access to and add an check based on the appState passed into the login options.

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