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

RefreshToken: Page reload is not handled correctly #76

Closed
skython opened this issue Jan 31, 2014 · 1 comment
Closed

RefreshToken: Page reload is not handled correctly #76

skython opened this issue Jan 31, 2014 · 1 comment

Comments

@skython
Copy link

skython commented Jan 31, 2014

After reloading the page my access_token cannot be refreshed in time anymore.

Problem:
I think the problem is, that ember-simple-auth just saves the expires_in value in the localstorage. After reloading the page, the localstorage value is read again and the application waits another expires_in time to refresh the token which will be too late.

Possible solution:
Maybe its better to save a timestamp with the current_time + expires_in in the localstorage and when the application is reloaded set the timeout based on the timestamp or invalidate the session if already too late.

@marcoow
Copy link
Member

marcoow commented Jan 31, 2014

Good point (also nice issue btw 👍); suggested solution should work perfectly.

I'm not sure whether auto-invalidating the session if it's already too late for the refresh is so great though - might be better to leave it and let the authorizationFailed hook handle the invalidation.

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

No branches or pull requests

2 participants