Skip to content

feat: support dynamic client URI for preview deployments#739

Merged
danielroe merged 5 commits intonpmx-dev:mainfrom
NandkishorJadoun:fix/oauth-preview-url
Feb 2, 2026
Merged

feat: support dynamic client URI for preview deployments#739
danielroe merged 5 commits intonpmx-dev:mainfrom
NandkishorJadoun:fix/oauth-preview-url

Conversation

@NandkishorJadoun
Copy link
Copy Markdown
Contributor

@NandkishorJadoun NandkishorJadoun commented Feb 2, 2026

Description

This PR fixes #714. It fixes the broken OAuth login on Vercel preview builds by removing the hard-coded production domain.

Changes

  • Module Refactor: Added environment detection logic to modules/oauth.ts.
  • Virtual File: Used addTemplate to inject the calculated clientUri into a virtual file (#oauth/config).
  • Logic Cleanup: Updated server/utils/atproto/oauth.ts to consume the URI from the virtual file, ensuring the correct client_id and redirect_uri are generated for Preview, Production, and Local environments.

Testing

  • Verified locally: clientUri defaults to http://127.0.0.1:3000.
  • Verified virtual file generation: Ran npx nuxt prepare with NUXT_ENV_VERCEL_ENV=preview and confirmed .nuxt/oauth-config.mjs contains the correct URL.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 2, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 2, 2026 4:25pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 2, 2026 4:25pm
npmx-lunaria Ignored Ignored Feb 2, 2026 4:25pm

Request Review

@NandkishorJadoun NandkishorJadoun changed the title feat(oauth): support dynamic client URI for Vercel preview deployments feat: support dynamic client URI for Vercel preview deployments Feb 2, 2026
@danielroe danielroe changed the title feat: support dynamic client URI for Vercel preview deployments feat: support dynamic client URI for preview deployments Feb 2, 2026
Copy link
Copy Markdown
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

perfect! 🔥

@danielroe danielroe added this pull request to the merge queue Feb 2, 2026
Merged via the queue into npmx-dev:main with commit d189f99 Feb 2, 2026
13 checks passed
@NandkishorJadoun NandkishorJadoun deleted the fix/oauth-preview-url branch February 3, 2026 08:41
taskylizard pushed a commit to taskylizard/npmx.dev that referenced this pull request Feb 7, 2026
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.

feat: public preview oauth logins

2 participants