feat(front): guard the account, sign-in and sign-up pages on the Session #542
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project!542
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/spec-409-implementation-862587"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Each route reads the Account through Query in its
beforeLoad(ADR 0019), so the page never renders before the redirect.The guards re-run when a Session changes. There is one place for it, not a call at every place a Session changes:
This covers sign-in, sign-up, sign-out, reset, deletion and a refused refresh. It fires after the new Account is read, so no
sleep(1)is needed.Decisions the spec left open:
deleteAccountMutationOptionstakesonDeletedand goes home before the reset. Otherwise the account guard would send the Player to sign-in.redirectsearch parameter, as in the TanStack example. Only this site's origin is accepted, sohttps://…,//…and/\…are refused./sign-in.Evidence
Before: with no Session,
/accountshows the signed-out panel; after signing in, the Player lands on/. A signed-in Player can open/sign-in.After:
route-guards.test.tsx(S1) passes:S2:
accounts.spec.tsopens the account page with no Session, signs in and lands on the account page. It then opens sign-in while signed in and lands home. The full e2e suite passed 43/43 locally.Gate on node 24: lint, typecheck, build, format:check and
test --force(1397 tests) are green. Drag tests timed out a few times when the machine was under heavy load, then passed on rerun.Merge Danger
Door: two-way
Blast Radius: auth navigation
The account, sign-in and sign-up routes and every Session change now re-run the guards. A wrong guard would send a Player to the wrong page; it causes no data loss. The heading-focus refactor also touches home and the Room entry.
Closes #409
added 14 commits
mainCompare with previous version
added 18 commits
main4386078b- feat(front): guard the account, sign-in and sign-up pages on the Sessionf42c5dca- refactor(front): drop the account page's signed-out copy, which nothing renders54bd79bc- test(e2e): send the account page to sign in and back, and a signed-in Player from sign-in home71b511d6- test(front): share the sign-in, sign-up and navigation helpers through the auth harness8fc8aa62- test(front): keep a Player who signs in on the sign-in page there for the claim offer06afab51- refactor(front): keep the heading a redirect lands on, and the state asking for it, in one placef7d0eddc- refactor(front): match on the Account in the route guards, and name their search check1e95eab2- refactor(front): say an auth link keeps the destination instead of passing a bare search86f8a1fd- refactor(front): track the Session's kind without an unread sentinel in the routeree4cc4e0- test(e2e): sign in on the page a redirect led to through the shared sign-in helperCompare with previous version
Screenshots
Before is production, after is this merge request's review app at
ee4cc4e.Desktop
Mobile