The sign-in hand-over delivers a personal token, not a session - #2
Merged
Conversation
app.zerops.io now mints a personal access token for this client instead of redirecting the account's own refresh token. It is already a bearer, so there is nothing to exchange — `adoptPersonalToken` replaces the refresh call. What it does instead is prove the token before storing it: a dead or revoked token that reached storage would render a signed-in-looking UI that fails on its first real call. So it is held in memory, spent on one `/user/info` read, and persisted only once that comes back. It carries no refresh token, which is correct rather than a gap: on a 401 the request path clears the session instead of trying to refresh, which is exactly what should happen to a token the user revoked.
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.
Platform half: zeropsio/frontend-legacy#300.
app.zerops.ionow mints a personal access token for this client instead of redirecting the account's own refresh token. A personal token is already a bearer, so there is nothing to exchange —adoptPersonalTokenreplacesadoptHandedOverSession, and the/auth/refreshround trip goes with it.The wire field is
#token=rather than#refreshToken=.What it buys
Notes for review
/user/inforead, and persisted only once that comes back. Pinned by a test asserting nothing is stored on a 401.readHandoverOnce), the fragment scrub and the door carve-out are unchanged from the previous PRs.Verification
366 tests across the Zerops client surface, typecheck clean, lint clean on every changed file.
Exercised against the live API and a real browser, not just unit tests: a personal token minted through
POST /user-tokenon a throwaway account, delivered to/zerops/authorized#token=…&state=…, produced a stored session of exactly{ accessToken }— 66 chars,hasRefresh: false— and the picker rendered "1 container across your organizations." The probe token was revoked afterwards.The full two-app loop cannot be exercised until #300 is deployed; everything up to and including the client's handling of a genuine token is covered.