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

Fix login flow when session expires #198

Merged
merged 5 commits into from
Jun 5, 2024
Merged

Conversation

thecodeboss
Copy link

Summary

Clear local storage if we detect that the token is expired. Fixes #197.

Notes

  • The isTokenExpired treats a token as expired if we're within 30 seconds of expiry. This matches the logic Verdaccio itself uses, which is important since the UI does not match up otherwise.
  • I used the parseJwt method from this Stack Overflow answer. I noticed the client code in this repo did not depend on any libraries, so I kept it that way.

n4bb12

This comment was marked as outdated.

@n4bb12
Copy link
Owner

n4bb12 commented Jun 5, 2024

Great, thank you

@n4bb12 n4bb12 merged commit a815fd6 into n4bb12:master Jun 5, 2024
4 checks passed
@thecodeboss thecodeboss deleted the fix-expiry branch June 5, 2024 16:44
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

Successfully merging this pull request may close these issues.

Login flow broken when sessions expire
2 participants