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

Token in localStorage cleared on page refresh of Angular application #44

Open
bertfonteyn opened this issue Jun 8, 2017 · 4 comments
Open

Comments

@bertfonteyn
Copy link

When the user logs in using standard email/password authentication, I can see a new key showing up in localStorage, containing the token.

When the page is refreshed, the key in localStorage is gone, which means the user has to log in again.

@claudiopetrini
Copy link
Contributor

Hello @bertfonteyn ,
can you make sure that your device is configured on a correct time please?
We're currently allowing a grace period of 30 seconds between the client and the server in which the token is kept in local storage, otherwise is removed.

Here is where the token deletion happens.

@claudiopetrini claudiopetrini self-assigned this Jun 9, 2017
@bertfonteyn
Copy link
Author

Hi @claudiopetrini ,

Thanks for reaching out to me so quickly.

I'm on a Mac, which sets the date/time automatically through time.apple.com. It should be very precise.

If I understand it correctly, when you perform a login action through the Stamplay JavaScript SDK, a token is returned, which is then stored in localStorage, and used in every subsequent request (as long as it's still valid)? So even though I refresh the Angular application, it should still keep the token?

@claudiopetrini
Copy link
Contributor

Hello @bertfonteyn ,yes you're correct.
The SDK saves the token in localStorage and reuses it until it's valid. The token should still be saved in localStorage after page refresh of course.
If you would like to debug this better and directly chat with us, feel free to join our Slack community.

@yasirgit
Copy link

Hi @bertfonteyn , have you found the solution yet. Because I am also struggling with this problem.

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

3 participants