Repository navigation
Fix stale logged-in UI when auth verify fails on network error - #833
Merged
devanshi14malhotra merged 1 commit intoMay 23, 2026
Merged
devanshi14malhotra merged 1 commit into
devanshi14malhotra merged 1 commit into
Conversation
Clear stored auth when /auth/verify cannot complete, matching 401/422 behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
✅ Deploy Preview for bibliodrift-dm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Looks good to me overall. Only thing worth noting is that temporary backend/network issues will now force logout instead of keeping cached auth state. |
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.
Description
After a successful login, the app stores
bibliodrift_userandisLoggedInin local storage and runsverifyStoredAuthSession()on page load to validate the current session throughGET /api/v1/auth/verify.Previously, if the verification request failed because the backend was unreachable (backend stopped, offline mode, CORS issue, wrong origin, etc.), the app would still fall back to the cached
storedUserfrom local storage. This caused the navbar to continue showing logged-in UI even though the session was never verified.This PR updates
verifyStoredAuthSession()infrontend/js/app.jsso failed verification requests are treated the same as invalid sessions.What changed
nullinstead of using cached session state401/422handlingcredentials: 'include'entry from the samefetchcallRelated Issue
Fixes #730
Type of Change
Testing
demo@bibliodrift.com)bibliodrift_userandisLoggedInexist in local storageindex.htmlorlibrary.htmlExpected Result
Screenshots
Optional: before/after navbar state when backend is unavailable.
Checklist