-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: warn if nextauth url and port doesn't match #1591
feat: warn if nextauth url and port doesn't match #1591
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
A new create-t3-app prerelease is available for testing. You can install this latest build in your project with: pnpm create [email protected] |
NEXTAUTH_SECRET: | ||
process.env.NODE_ENV === "production" | ||
? z.string() | ||
: z.string().optional(), | ||
NEXTAUTH_URL: z.preprocess( | ||
// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL | ||
// Since NextAuth.js automatically uses the VERCEL_URL if present. | ||
(str) => process.env.VERCEL_URL ?? str, | ||
(str) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this is actually the best place to put this, it might continue getting logged more than necessary. an alternative would be putting it in the next config but then we'd need to make a new one for when you choose auth and add this logic there instead. (we're already adding a new one in the appdir pr removing the i18n config stuff)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maintenance burden of adding new files aside, next config feels better to me - here the validation has to run on every request, which seems unnecessary. in next config we could just crash (or log an error, but crashing is harder to ignore) on server start and be done with it.
@juliusmarminge what do you think? is the main reason for having it here that it's not adding more files, or are there other advantages to doing it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah i think next config is the better choice - put it here purely out of convenience of not having multiple next configs but that's not the best reason π
3f8dc77
to
2a4799e
Compare
Closes #
β Checklist
Changelog
[Short description of what has changed]
Screenshots
[Screenshots]
π―