Repository navigation
Bump client/shared: fix login lockout for stale/expired sessions - #120
Merged
Merged
Conversation
usePermissions() caches for 5 minutes and isn't refreshed on login, so right after logging in from the anonymous homepage the app could still show the same logged-out homepage instead of the dashboard.
localStorage.auth never expires on its own, so a week-old cached session could bounce a genuinely logged-out returning user away from the login form forever - checkAuth now validates against the server instead of trusting localStorage presence.
Avoids a real network call on every checkAuth invocation (route changes, tab refocus) while still catching a genuinely stale (e.g. week-old) session promptly instead of trusting it indefinitely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
client/shared(nra-client) to pick up two fixes:usePermissions()cache right after login.authProvider.checkAuthnow validates a cached session against the server (time-boxed to a 5-minute trust window) instead of trustinglocalStorage.auth's mere presence, which never expires on its own. Previously, a returning user with an old session could get bounced away from the login form forever.See buzz-code/nra-client#32 for the underlying change and test plan.
Test plan
Generated by Claude Code