Repository navigation
fix(auth): a session the API refuses ends at /login, not at a default shell (QA sweep ONB-04) - #32
Merged
Merged
Conversation
… shell (QA sweep ONB-04)
A token issued before a password change or reset still has a live `exp`, so
`requireToken` lets it through, but the API refuses it (`pwchanged:{userId}`).
The auth layout loader swallowed that 401 as a "graceful fallback" and the page
came back 200 as an "Unnamed" shell on openinspection.dev with no Dispatch item,
on every reload.
The loader now ends the session on a 401 from the session-context call
(`destroyUserSession`: both cookies cleared, 302 to `/login`), the same place a
visitor with no cookie lands. Only 401 does this; a 5xx or a thrown fetch keeps
the defaults, since the token may be fine.
Tests: `auth-layout.loader.test.ts` (red against the unfixed loader), and the
password-reset e2e now keeps the pre-reset session and expects 302 to `/login`
for it, with the fresh session as the control. fork-log row added; the NET-06
ceiling about a password-changed token bounced to `returnTo` is amended.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
What
QA sweep finding ONB-04 (Major). A session issued before a password change or reset loaded the workspace shell at HTTP 200 as "Unnamed" on
openinspection.dev, with no Dispatch item, on every reload.Why
The token's
expis still live, sorequireTokenlets it through, but the API refuses it (pwchanged:{userId}). The loader inapp/routes/auth-layout.tsxswallowed that 401 from the session-context call as a "graceful fallback" and rendered default branding.Change
destroyUserSession: both cookies cleared, 302 to/login), the same place a visitor with no cookie lands.docs/develop/fork-log.md: new row, and the NET-06 ceiling about a password-changed token bounced toreturnTois amended.Upstream
No fix there:
git fetch upstreamplus keyword and file greps (stale session, pwchanged, password reset, auth-boundary files) found only the TOTP and invite-link fixes. Fork deviation, recorded in the fork log.Tests
app/routes/auth-layout.loader.test.ts(4 cases); the 401 case fails against the unfixed loader.tests/e2e/auth-password-reset.spec.ts: keeps a session from before the reset and expects 302 to/loginfor it, with the fresh session as the control. Not run locally (no Chromium); it runs in the e2e legs.lint:gates27 of 27, eslint 0 errors, pre-commit and pre-push passed.Known ceilings
returnTois not carried, and/loginshows no "password changed" notice (it would need a message in both catalogs).🤖 Generated with Claude Code