Parent: #244
Epic: #15
Severity: Medium
Execution mode: AFK
What to build
Treat login, bootstrap refresh, explicit refresh, and logout as one browser-session state machine. Today an in-flight refresh can complete after logout and restore authenticated state, or an older bootstrap refresh can overwrite a newer login. Logout also swallows server errors without making the local invalidation ordering explicit.
Use a monotonically increasing session generation and cancellation where possible. A completion may update tokens and user state only if it belongs to the active generation. Local logout must win immediately even when the server revoke call fails; the error can be reported without restoring the session.
Acceptance criteria
Blocked by
None.
Parent: #244
Epic: #15
Severity: Medium
Execution mode: AFK
What to build
Treat login, bootstrap refresh, explicit refresh, and logout as one browser-session state machine. Today an in-flight refresh can complete after logout and restore authenticated state, or an older bootstrap refresh can overwrite a newer login. Logout also swallows server errors without making the local invalidation ordering explicit.
Use a monotonically increasing session generation and cancellation where possible. A completion may update tokens and user state only if it belongs to the active generation. Local logout must win immediately even when the server revoke call fails; the error can be reported without restoring the session.
Acceptance criteria
Blocked by
None.