You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Auth: idempotent refresh to close the tab-death cross-tab residual (#169 follow-up) #176
Follow-up from the #169 (PR #175) review (codex). #169 serialises refresh across tabs with the Web Locks API, which eliminates the common multi-tab race. One narrow residual remains that a page-owned lock cannot close:
Tab A acquires the lock and sends refresh token R0. The server commits R0→R1 and sets the rotated cookie, but Tab A is closed/reloaded in the sub-second before the response + Set-Cookie are processed. Unloading auto-releases the Web Lock while the cookie is still R0. Tab B then acquires the lock, presents R0 (now revoked), and trips reuse-detection → whole-family revocation → both tabs logged out.
A lock held by a page cannot make server rotation and cookie receipt atomic, so the client alone cannot fully close this.
Proposed fix (server-side)
Make refresh idempotent for a short window: the client sends a stable per-exchange request id (or the server keys on the presented token + its immediate replacement). A repeat of the same exchange returns the same replacement instead of being treated as a replay, while an unrelated old/stolen token still trips strict reuse-detection.
Activity
F169 review: bound the cross-tab lock, verify shared lock name, doc r…
F169: serialise refresh across tabs (Web Locks) — no spurious multi-t…
F176: idempotent refresh grace — close the #169 tab-death residual (#180
F165 review: exempt token responses from idempotency cache, atomicity…
F165: password management — admin set + self-service change (API + SP…
fix(api): recover the ambiguous commit on every auth-token save (#269)
feat(api): bounded retry-on-failure for transient DB connection loss (#…
spec: fix the epoch cutover and the check's position in RefreshAsync
spec: design user disable/enable and email change (#356, #357) (#358)
fix(auth): measure the refresh grace window from the read, not the re…
test(auth): probe the legacy token first, so the same-farm guard is real
feat!: log in by farm code, with per-account email identity (#532) (#564