Repository navigation
fix: flush PKCE verifier slot removals on the server - #275
Merged
Merged
Conversation
Tr00d
approved these changes
Jul 28, 2026
mandarini
added a commit
that referenced
this pull request
Jul 28, 2026
This PR updates `@supabase/supabase-js` to v2.111.0. **Source**: supabase-js-stable-release --- ## Test update included supabase-js 2.111.0 ([supabase/supabase-js#2569](supabase/supabase-js#2569)) stores PKCE verifiers in per-flow slots, so a flow start now writes three storage keys instead of one: the per-flow slot, the flow index, and the legacy fixed `-code-verifier` key. Our server storage adapter flushes each of these immediately (by design — slot keys deliberately end in `-code-verifier`), so `setAll` now fires 3 times per flow start instead of 1. The PKCE verifier test asserted that internal flush count and snapshotted the exact cookies, so we updated it: expect 3 `setAll` calls, normalize the random flow id in slot cookie names, and regenerate the snapshots. Test-only change — no source changes needed, the adapter was already prepared in #275. **Why this isn't a breaking change in supabase-js:** the writes are purely additive — the legacy key is still written with the same format, and `exchangeCodeForSession` without a flow id reads it exactly as before. The new slot-only lookup only kicks in when a flow id is explicitly passed or the opt-in `experimental.appendPkceFlowIdToRedirects` flag is enabled. --- ## Release Notes ## v2.111.0 ## 2.111.0 (2026-07-28) ### 🚀 Features - **auth:** store PKCE verifiers in per-flow slots to survive overlapping flows ([#2569](supabase/supabase-js#2569)) ### ❤️ Thank You - Katerina Skroumpelou @mandarini This PR was created automatically. --------- Co-authored-by: supabase-workflow-trigger[bot] <266661614+supabase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: Katerina Skroumpelou <[email protected]>
mandarini
pushed a commit
that referenced
this pull request
Jul 28, 2026
🤖 I have created a release *beep* *boop* --- ## [0.12.4](v0.12.3...v0.12.4) (2026-07-28) ### Bug Fixes * flush PKCE verifier slot removals on the server ([#275](#275)) ([6df6f03](6df6f03)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
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.
auth-js stores each in-flight PKCE code verifier in its own cookie slot (
<storageKey>-flow-<flowId>-code-verifier), bounded by a ring of five. The server storage applies writes to-code-verifierkeys immediately but leaves removals buffered until anonAuthStateChangeevent, and a flow start fires no such event: when the ring evicts the oldest slot, that removal is discarded while the index write dropping the evicted id is applied, orphaning a verifier cookie that nothing references and no cleanup path can reach.This applies the storage on removal for per-flow slot keys only, so the fixed
-code-verifierkey and the-flows-code-verifierindex keep their existing buffered behavior and no current code path changes. Impact is cookie hygiene rather than credential exposure, since a verifier with no matching auth code grants nothing.docs/design.mdis the only place documenting when the server applies storage to cookies, so the new exception is recorded there. That section also never mentioned the existing immediate flush for verifier writes, and its event list had drifted fromcreateServerClient.ts, so both are corrected alongside it.