Repository navigation
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This was referenced Aug 5, 2026
authup
@authup/client-account-console
@authup/client-admin-console
@authup/client-auth-console
@authup/server-core
@authup/access
@authup/client-web-kit
@authup/client-web-kit-theme
@authup/client-web-nuxt
@authup/client-web-theme
@authup/core-http-kit
@authup/core-kit
@authup/core-realtime-kit
@authup/errors
@authup/i18n
@authup/kit
@authup/server-adapter-kit
@authup/server-adapter-node
@authup/server-adapter-socket-io
@authup/server-adapter-web
@authup/server-kit
@authup/server-test-kit
@authup/specs
commit: |
Cookies are per origin, not per application, and the hosted auth pages share their origin with everything else server-core serves. So every surface there used one set of tokens: the account console adopted whatever login came before it, and its own tokens were readable by the next surface on the origin. Locally it is broader still, because cookies ignore the port, so an app on localhost:3000 shares the jar with the IdP on :3001. The store takes a `cookiePrefix`, writing `<prefix>.<name>`. That splits the jar in two, and the tiers are told apart by the prefix alone: - BARE names are the IdP's own SSO session, owned by the hosted auth pages. They are not a client, they are the IdP surface, and their session is what the prompt=none / select_account ladder reads. - A PREFIXED set belongs to one application. Both consoles set it to their OAuth2 client name; any relying party embedding the kit should too. `.` rather than `:` because RFC 6265 defines a cookie name as an RFC 2616 token, whose separator set includes `:`. Browsers accept it, proxies and cookie libraries do not uniformly. The prefix is the client NAME, which an application knows before it has any session, never the client id, which it cannot know until it has one. Clearing shadowed copies follows the prefix and deliberately leaves the bare tier alone: clearing it would sign the visitor out of the IdP as a side effect of loading an application. One consequence is deliberate and unresolved: the account console no longer adopts the IdP session, so a visitor arriving from another application picks a realm once instead of being carried straight through. Seeding that from the IdP session needs a carrier the store does not write today, because the realm is set directly from introspection precisely to avoid persisting it. That is tracked in plan 087 rather than guessed at here. BREAKING CHANGE: store cookies written by an application configured with a `cookiePrefix` use `<prefix>.<name>`. Existing bare cookies are not migrated, because they cannot be attributed to an application, so every prefixed application signs out once on upgrade. A consumer reading `CookieName` values off the document directly must add the same prefix.
tada5hi
force-pushed
the
feat/per-client-session-isolation
branch
from
August 5, 2026 08:25
8835511 to
430501b
Compare
tada5hi
added a commit
that referenced
this pull request
Sep 2, 2026
* fix(client-web-nuxt): forward every declared module option `runtimeOptions` was a hand-written list of six fields, and the type it is annotated with is `RuntimeOptions` itself (`ModuleOptions` is an alias of it), so the list could only ever fall behind. It already had: `serverApiURL` is declared and read by the plugin, yet never reached `runtimeConfig`, so setting it under the `authup:` module key did nothing. Spread the options instead. `defaults` is empty, so the spread is exactly the declared surface, and a new option cannot be silently inert. * feat(client-web-nuxt): allow namespacing the session cookies The store cookies are written under fixed names (`access_token`, `refresh_token`, ...) and the only scoping knob was `cookieDomain`. Widening that domain delivers those names to every host under it, so any other authup client reachable there writes the same names, the browser holds two records under one, and a read takes the first. Each side then drives on, refreshes and cleanup-revokes the other's tokens, which surfaces as being signed out on the next page load. Observed in FLAME Hub, which widens the domain so a sibling service can read the token on a file download, a top-level navigation that cannot carry an `Authorization` header. `cookiePrefix` prepends a namespace, verbatim, so `flame_` writes `flame_access_token`. It goes in the plugin's own `cookieGet` / `cookieSet` / `cookieUnset` rather than in `@authup/client-web-kit`, and that is total rather than partial: `installStore` routes every read, write and unset through those three, the two cleanup sweeps included, so they follow the prefix and stop clearing a bare name that belongs to somebody else. The kit needs no option of its own, which is also why this does not revive the parked kit-level `cookiePrefix` of #3403: that one was about the consoles sharing the IdP origin, where a second cookie set doubles header weight on every request. Only a consumer supplying its own `cookieSet` can set a `Domain` at all, since the kit assigns one nowhere, so in every cross-host collision the widening side is the side that can prefix, and breaking name equality on one side is enough. Two consequences are documented rather than coded around. The prefix is a contract across the adopting app's own services, so a resource server of theirs reading the cookie must read the prefixed name. And cookies written before the prefix was set are afterwards neither read nor swept; an automatic sweep is deliberately refused, because under a widened domain it would delete a not-yet-migrated sibling's cookies, and on the IdP origin it would clear the hosted auth pages' own SSO cookies, signing the visitor out as a side effect of loading an app. Closes #3527 * docs(client-web-nuxt): correct the cookie-prefix migration advice Signing out after the switch clears the PREFIXED names, so it does nothing about the bare ones, and `access_token` / `access_token_expire_date` carry a maxAge derived from the access token's lifetime, so closing the browser does not remove them either. Both halves of the previous sentence were wrong. Sign out BEFORE setting the prefix and there is nothing stale to begin with. For someone who already switched, name which leftovers are session cookies and which pair expires on its own.
tada5hi
added a commit
that referenced
this pull request
Sep 2, 2026
… the hosted session (#3535) Cookies ignore ports, so localhost:3010 and localhost:3000 are one host to the browser. A console dev server started while a session from the hosted auth pages is open seeds itself from that session's path-`/` token cookies and comes up signed in, without running the flow under test. The last open half of plan 098 D1; the #3403 half was closed as parked.
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.
The server-side half of the original stack was split out and is mergeable on its own as #3404.
What this does
Cookies are per origin, and the hosted auth pages share theirs with everything server-core serves, so every surface used one set of tokens: the account console adopted whatever login came before it, and its own tokens were readable by the next surface. Locally it is broader still, since cookies ignore the port.
The store takes a
cookiePrefixand writes<prefix>.<name>. Bare names are the IdP's own SSO session (owned by the hosted auth pages, which are the IdP surface rather than a client); a prefixed set belongs to one application..and not:because RFC 6265 defines a cookie name as an RFC 2616token, whose separator set includes:. The prefix is the client name, which an app knows before it has a session, never the id, which it cannot know until it has one.Shadow-clearing follows the prefix and deliberately leaves the bare tier alone: clearing it would sign the visitor out of the IdP as a side effect of loading an app. Pinned by a test verified to fail if the implementation reverts.
Why it is parked
Header size. Namespacing fixes sharing by making the IdP origin carry two cookie sets instead of one, so header weight roughly doubles there: three JWTs plus a
userblob per set, on every request including assets. Roughly 3-8 KB against nginx's default 8 KB buffer. An opaque session identifier collapses that to about 40 bytes and also makes the credentialHttpOnly, which no amount of namespacing achieves.Realm continuity. With its own namespace the account console no longer adopts the IdP session, so a visitor arriving from another application picks a realm once. An earlier revision read the realm from the bare tier; that could not work, because nothing writes that cookie (
setRealmis called only by cleanup and hydration, while introspection writesrealm.valuedirectly by design). It was removed rather than carried along.