fix: warn when auth.storage is ignored by createBrowserClient/createServerClient - #284
Merged
Conversation
mandarini
marked this pull request as ready for review
August 14, 2026 16:52
Tr00d
approved these changes
Aug 17, 2026
Dedupe the auth.storage warning via a warnOnce helper so per-request createServerClient calls don't spam logs, and move the check after the singleton short-circuit and URL/key validation so no-op or throwing calls don't warn. Adds warns-once tests for both clients and a behavioral server test proving the cookie-backed storage still wins.
mandarini
force-pushed
the
fix/warn-ignored-storage-option
branch
from
August 24, 2026 11:01
1175e70 to
f923e3f
Compare
mandarini
pushed a commit
that referenced
this pull request
Aug 24, 2026
🤖 I have created a release *beep* *boop* --- ## [0.12.5](v0.12.4...v0.12.5) (2026-08-24) ### Bug Fixes * warn when auth.storage is ignored by createBrowserClient/createServerClient ([#284](#284)) ([c1700f2](c1700f2)), closes [#142](#142) --- 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.
createBrowserClientandcreateServerClientalways store the session via cookies, so anyauth.storageyou pass in is silently overwritten and has no effect. This adds a one-time console warning when that option is passed, plus a short doc note (in both functions' tsdoc and the README) clarifying thatauth.storageis ignored, whileauth.userStorageremains respected whencookies.encodeis"tokens-only".The warning is deduped via a small
warnOncehelper (kept out of the public API), so apps that create a server client per request log it once per process instead of on every request. The check also runs after the singleton short-circuit and URL/key validation, so a cached no-opcreateBrowserClientcall or a call that's about to throw doesn't warn. Tests cover the warning firing, firing only once across multiple calls, and (behaviorally, on the server client) that the cookie-backed storage still wins over a customauth.storage.No behavior change: the cookie-backed storage still always wins, this only makes the existing no-op visible instead of silent.
Fixes #142