Skip to content

fix: respect variable set in Netlify config for NEXTAUTH_URL #1613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

ericapisani
Copy link

also support deploy preview urls for the NEXTAUTH_URL value

Summary

Fixes #1611

Values set for the NEXTAUTH_URL within netlify.toml or the Netlify UI weren't being set correctly as part of the build process, so these changes not factor that into the logic for patching the required_server_files.json.

We also previously would only set the NEXTAUTH_URL to the production URL value. This now supports branch deploy or deploy preview URLs as the NEXTAUTH_URL value.

Test plan

There's repro steps on the issue but tl;dr - try various permutations of setting the URL via the netlify.toml, netlify ui, environment variable, not setting it at all in the next-auth project

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

sea_turtle

also support deploy preview urls for the NEXTAUTH_URL value
@ericapisani ericapisani added the type: bug code to address defects in shipped code label Sep 9, 2022
@ericapisani ericapisani self-assigned this Sep 9, 2022
@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/631b6b22a1404e0009424eb3
😎 Deploy Preview https://deploy-preview-1613--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/631b6b229ca91500088853fc
😎 Deploy Preview https://deploy-preview-1613--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for next-hp-edge-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/next-hp-edge-demo/deploys/631b6b22aa2eb000099172e8
😎 Deploy Preview https://deploy-preview-1613--next-hp-edge-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo failed.

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/631b6b22918d6b00082b67ba

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/631b6b222571c5000e9d13c7
😎 Deploy Preview https://deploy-preview-1613--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/631b6b22cfbc8700084ed3ce
😎 Deploy Preview https://deploy-preview-1613--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/631b6b227946e3000889600e
😎 Deploy Preview https://deploy-preview-1613--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/631b6b2274c55300080e8c79
😎 Deploy Preview https://deploy-preview-1613--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/631b6b227bd356000810c5ea
😎 Deploy Preview https://deploy-preview-1613--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@ericapisani ericapisani marked this pull request as ready for review September 9, 2022 14:39
@ericapisani ericapisani requested a review from a team September 9, 2022 14:39
@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/631b6b227bd356000810c5e5
😎 Deploy Preview https://deploy-preview-1613--next-plugin-canary.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 9, 2022

Deploy Preview for next-plugin-rsc-demo failed.

Name Link
🔨 Latest commit 916671e
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/631b6b2202871200094f791e

Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

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

Looks good

@kodiakhq kodiakhq bot merged commit 18c4663 into main Sep 9, 2022
@kodiakhq kodiakhq bot deleted the ep-handle-deploy-preview-next-auth-url branch September 9, 2022 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: NEXTAUTH_URL is set as prod URL on deploy preview
2 participants