Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix(init): refresh auth before wizard startup - #1384

Merged
betegon merged 3 commits into
mainfrom
fix/init-auto-auth-preflight
Aug 7, 2026
Merged

betegon merged 3 commits into
mainfrom
fix/init-auto-auth-preflight

Conversation

@betegon

@betegon betegon commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Make sentry init use the CLI's shared OAuth refresh and auto-login path before constructing the wizard UI. An expired stored access token with a valid refresh token is now refreshed immediately; missing or expired interactive credentials reach the global auto-auth middleware, which logs in and retries the command.

The readiness check now only probes the setup service, and init preflight preserves AuthError and HostScopeError instead of collapsing them into generic wizard failures. On macOS, init requests its existing force-exit safety net and the outer CLI pipeline schedules it only after auth recovery reaches a terminal result, so it cannot interrupt login/retry and still covers failed or cancelled login. Non-interactive runs still require credentials up front.

Closes #1383.

Test plan

  • pnpm exec vitest run test/commands/init.test.ts test/lib/auto-auth.test.ts test/lib/init — 35 files, 510 tests passed
  • pnpm run typecheck
  • pnpm run lint — 973 files checked
  • pnpm run check:fragments — passed with the existing unrelated proguard upload coverage warning

@betegon
betegon marked this pull request as ready for review August 7, 2026 10:05
Comment thread packages/cli/src/lib/init/preflight.ts Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit eb4f0a6. Configure here.

Comment thread packages/cli/src/commands/init.ts Resolved
@betegon
betegon marked this pull request as draft August 7, 2026 10:30
@betegon
betegon marked this pull request as ready for review August 7, 2026 10:39
@betegon
betegon merged commit f349372 into main Aug 7, 2026
44 of 46 checks passed
@betegon
betegon deleted the fix/init-auto-auth-preflight branch August 7, 2026 11:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sentry init does not trigger auto-auth fallback

1 participant