Conversation
Login adds or updates a profile keyed by user ID and makes it active. Logout removes the active profile and activates the most recently logged-in one that remains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nto claude/multi-account-login-1386 # Conflicts: # src/commands/auth/logout.ts # src/lib/auth.ts # test/local/commands/auth.test.ts
This branch has not been deployed
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.
Note
TL;DR —
apify loginnow adds an account instead of replacing the stored one, and makes it active.apify logoutremoves the active account and activates the most recently logged-in one that remains.Stacked on #1450 (base
claude/secret-storage-v2-1420), which is stacked on #1434. Retarget once those land.Closes #1386. Part of #1297.
Change
replaceStoredAccount()→upsertProfile(). It keeps other profiles. A stored profile keeps its ownsecretsBackendand file secrets on re-login.loggedInAtis refreshed on every login.name=username, falling back to the user ID.secretsBackendis set only on a new file. A new or re-logged profile whose backend differs records its own, so a login withAPIFY_DISABLE_KEYRING=1cannot redirect other accounts' reads.removeActiveProfile()picks the next active profile byloggedInAt(nulllast) and returns the removed and new active profile. Telemetry user ID follows the new active one.Other stored accounts: A.when others exist. Logout saysYou are logged out of B. A is now the active account.docs/regenerated.Verification
pnpm run test:local— 687 passed, 4 skipped (64 files).pnpm run lint,pnpm run format,pnpm run build— clean.pnpm run update-docs— logout description only.pnpm run test:apinot run — no token in this environment.loggedInAt, keyring entries kept per account, logout clearing only the outgoing account, and a keyring-disabled login leaving other accounts on the keyring.Left out
--profile,auth switch,auth list,logout --profile/--all— Stage-3 (Stage-3: Multi-account UX #1384).name: nulluntil their next login. Stage-3 may want the migration to set it.login -m consolebecomes additive throughtryToLogin, with no dedicated tests, as the issue says.🤖 Generated with Claude Code