fix(auth): accept epoch-changing token refreshes - #9560
wunianze666-netizen wants to merge 4 commits into
Conversation
|
Synced this branch with current |
|
Added an end-to-end negative regression in Validation: 25/25 focused auth/API tests passed with no TypeScript errors; targeted ESLint, Prettier, and |
|
Added a backward-compatibility regression for sessions carrying JWTs minted before the token_epoch claim existed (commit 5cad312). The end-to-end refresh test now covers both explicit epoch 0 and an omitted epoch claim, and verifies that an epoch 1 replacement is accepted inside the normal one-minute throttle, synchronizes the media cookie, and dispatches tokenRefreshed. Validation: 6 auth test files / 40 tests passed with no type errors; targeted ESLint and Prettier checks passed; git diff --check passed. |
|
The new |
Summary
dynamicBaseQuery-> media-cookie sync -> Redux dispatch pathRelated Issues / Discussions
Closes #9541
QA Instructions
pnpm exec vitest run(170 files, 2,227 tests)pnpm run lint:tscpnpm run lint:dpdmpnpm exec eslint --max-warnings=0 src/features/auth/store/authTokenRefresh.ts src/features/auth/store/authTokenRefresh.test.ts src/services/api/index.ts src/services/api/endpoints/auth.test.tspnpm exec prettier --check src/features/auth/store/authTokenRefresh.ts src/features/auth/store/authTokenRefresh.test.ts src/services/api/index.ts src/services/api/endpoints/auth.test.tsThe integration regression marks a routine refresh as recently accepted, returns a same-user token with an incremented
token_epoch, and verifies that the media cookie is synchronized beforetokenRefreshedis dispatched. Unit coverage keeps same-epoch, cross-user, and unreadable replacements throttled.Merge Plan
No special merge handling is required.
Checklist