Skip to content

fix: Preserve Legacy Vercel Auth Compatibility#12627

Open
anthonyshew wants to merge 9 commits intomainfrom
shew/fix-legacy-vercel-auth-compat
Open

fix: Preserve Legacy Vercel Auth Compatibility#12627
anthonyshew wants to merge 9 commits intomainfrom
shew/fix-legacy-vercel-auth-compat

Conversation

@anthonyshew
Copy link
Copy Markdown
Contributor

@anthonyshew anthonyshew commented Apr 15, 2026

Summary

  • Stop writing device-flow vca_ access tokens to the legacy turborepo/config.json slot that older Turbo releases still validate via /v5/user/tokens/current.
  • Store device-flow sessions in a Turbo-owned turborepo/auth.json instead, and teach auth lookup plus logout to prefer and clear that file while still falling back to shared Vercel auth and legacy config tokens.
  • Add coverage for the new auth-file precedence and legacy fallback, plus the small lint/config edge-case fixes needed for the repo's pre-push checks.

How to Test

Upgrade and downgrade between affected versions and you'll get breakages against Vercel APIs. Those will now be resolved with this PR.

anthonyshew and others added 9 commits March 5, 2026 14:26
…Grant (RFC 8628)

Replace the axum-based localhost HTTP server login flow with the OAuth 2.0
Device Authorization Grant (RFC 8628). The user now visits a URL and enters
a code in the browser instead of relying on a localhost redirect.

- Add device_flow module implementing RFC 8628 (discover, device auth,
  token polling, introspection)
- Remove login_server.rs, axum/axum-server/async-trait/anyhow dependencies
- Remove TURBO_SSO_LOGIN_CALLBACK_PORT env var and sso_login_callback_port config
- SSO flow still uses a one-shot TcpListener for redirect, now with
  spawn_blocking, bounded reads, timeouts, and CSRF state validation
- Write OAuth tokens to both Vercel CLI auth.json and turbo config.json
- Custom Debug impl on TokenSet to redact secrets
- Validate OIDC discovery endpoint origins against issuer domain
- Derive OIDC issuer from login_url to support self-hosted deployments
- Display user_code during device flow per RFC 8628 §3.3 MUST requirement
- Loop listener.accept in login/SSO redirects to handle browser preflight
  and favicon requests instead of consuming the single-shot listener
- Deduplicate is_vercel into auth/mod.rs
- Add subdomain validation test proving ends_with check is correct
- Add CSPRNG note on rand::random() usage for CSRF state generation
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
examples-vite-web Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm
turbo-site Ready Ready Preview, Comment, Open in v0 Apr 15, 2026 10:11pm

@anthonyshew anthonyshew requested a review from a team as a code owner April 15, 2026 22:10
@anthonyshew anthonyshew requested review from tknickman and removed request for a team April 15, 2026 22:10
@anthonyshew anthonyshew changed the base branch from shew/stop-login-server to main April 15, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant