Token persistence integration + password handling contracts - #676
Merged
zakkiyyat merged 2 commits intoJun 29, 2026
Conversation
Integrate token persistence end-to-end (MixMatch-Inc#607): - Include refreshToken in register/login responses (auth.service.ts) - Add refreshToken to AuthTokenResponse shared type - Add refreshAccessToken and fetchAuthenticated to API client - Auto-refresh expired tokens on page load and on 401 - Store refreshToken alongside accessToken in localStorage - Guard against concurrent refresh requests Harden token persistence edge cases (MixMatch-Inc#606): - Check JWT expiry on mount, background refresh if expired - Handle corrupted localStorage gracefully - Handle 401 after failed refresh (SESSION_EXPIRED error) - Concurrent refresh protection via shared promise ref Define password handling scope and contracts (MixMatch-Inc#613): - Add formal contract: boundary, inputs, outputs, schema contract Implement password handling core flow (MixMatch-Inc#614): - Document full lifecycle in password-handling.md Closes MixMatch-Inc#606 Closes MixMatch-Inc#607 Closes MixMatch-Inc#613 Closes MixMatch-Inc#614
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.
Summary
Closes #606, Closes #607, Closes #613, Closes #614
Token persistence (#607)
buildTokenResponseinauth.service.tsto includerefreshTokenin register/login responses (was previously discarded)refreshTokentoAuthTokenResponseinpackages/shared/src/types/auth.tsrefreshAccessToken()andfetchAuthenticated()toapps/web/src/lib/api-client.tsauth-context.tsxto storerefreshToken, auto-refresh expired tokens on page load, and exposefetchWithAuth()that transparently refreshes on 401apps/docs/token-persistence.mdcovering data flow, storage, security, and edge case handlingToken persistence edge cases (#606)
Password handling scope and contracts (#613)
password-handling.mdPassword handling core flow (#614)
Impact