Repository navigation
Notify user about Session expiries - #365
Open
Bohreromir wants to merge 4 commits into
Open
Bohreromir wants to merge 4 commits into
Bohreromir wants to merge 4 commits into
Conversation
API routes redirected unauthenticated requests to the HTML login page, so client-side fetch callers failed with a JSON parse error once the session had expired. Page routes still redirect to the login page. Refs #356 asdf
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wrap window.fetch in the client init hook so that any same-origin 401 triggers a session check. A 401 alone is not proof of an expired session (the storage API uses it for a missing connection), so only an explicit "no session" answer from better-auth marks the session as expired. Refs #356 fix(auth): ignore session check results after the layout unmounts Refs #356
Show a non-dismissible modal with a link to sign in again, returning the user to the current page afterwards. The session is also checked when the tab becomes visible again, so the modal appears before the next API call. Modal gains a dismissible prop and passes through attributes such as aria-labelledby. Refs #356
Bohreromir
force-pushed
the
worktree-fix-356-session-expiry
branch
from
October 8, 2026 09:04
e0ed631 to
13cfaa7
Compare
Bohreromir
marked this pull request as ready for review
October 8, 2026 09:19
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.
Now the user gets a blocking modal informing him about the session expiry.
This makes the cockpit not fail randomly from a user perspective.