Skip to content

fix: skip device auth when unclaimed environment is active#115

Merged
nicknisi merged 2 commits intomainfrom
fix/unclaimed-env-skips-device-auth
Apr 1, 2026
Merged

fix: skip device auth when unclaimed environment is active#115
nicknisi merged 2 commits intomainfrom
fix/unclaimed-env-skips-device-auth

Conversation

@nicknisi
Copy link
Copy Markdown
Member

@nicknisi nicknisi commented Apr 1, 2026

Summary

  • checkStoredAuth in the installer state machine only checked for OAuth tokens (getAccessToken()), ignoring active unclaimed environments that already have valid apiKey + claimToken
  • This caused the CLI to force unnecessary device auth, which would hang on "Waiting for authentication..." even after the browser showed success
  • Now checkStoredAuth recognizes unclaimed environments as valid auth, skipping device auth and flowing directly to fetchingStagingCredentials (which already handles unclaimed envs)

Test plan

  • pnpm build passes
  • pnpm typecheck passes
  • pnpm test passes
  • With an active unclaimed env and no OAuth credentials, workos install skips device auth and proceeds directly

nicknisi added 2 commits April 1, 2026 11:45
checkStoredAuth only checked for OAuth tokens, so the state machine
forced device auth even when a valid unclaimed environment (with apiKey
+ claimToken) was already active. This caused the CLI to hang on
"Waiting for authentication..." after the browser showed success.
@nicknisi nicknisi merged commit 3c95642 into main Apr 1, 2026
5 checks passed
@nicknisi nicknisi deleted the fix/unclaimed-env-skips-device-auth branch April 1, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant