Route guards: the account page needs a Session, sign-in and sign-up send a signed-in Player home #409
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#409
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem Statement
Source: the front audit,
docs/research/front-audit.md, sections 1 (point 10) and 2.1. The owner decided both redirects (section 5).Solution
User Stories
Seams
apps/e2e(e2e). Covers 1-2 and 6 in a real browser: a new test inaccounts.specopens the account page with no Session, signs in, and lands on the account page; then opens sign-in while signed in and lands home.Implementation Decisions
beforeLoadon the account route, the sign-in route and the sign-up route. Each reads the Account through Query (ensureQueryDataof the existing Account query options), so the router and the components share one answer (ADR 0019). No auth object is added to the router context: the Account query already is the source of truth.location.hrefinbeforeLoad, per the Router docs. Sign-in and sign-up navigate there after success, after the claim offer where there is one.sleep(1); a test must show the guard sees the new Session.Testing Decisions
router.test.tsx(mountRouter),session-refresh.test.tsx(a lost Session),sign-in.test.tsx(the claim offer);accounts.spec.tsinapps/e2e.Out of Scope
Further Notes
docs/research/front-audit.mdon branchclaude/nestjs-best-practices-audit-716d79.implementon this spec.mentioned in merge request !533
mentioned in commit 4cf15eb2efbfab85fc0fe292c67cdcca68732e27
mentioned in commit b818f65dfb901ad349e99c96be2f59b879dd3349
mentioned in commit fb942db36cd91a4bb9731e54f3d6a3b451643d9c
mentioned in merge request !542
mentioned in commit 04f2d27157a54e9cd08288eb86e357edcbc6e465
mentioned in commit d76c8f382c3c60b5ed1f2aef26f1842a8215bbfe
mentioned in commit 348a3e7fa45606819f341c851bedebb6825e0037
mentioned in commit
4386078b5amentioned in commit
54bd79bc0amentioned in commit
f42c5dcac8mentioned in issue #440
mentioned in issue #443