Skip to content
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

Closed

Conversation

juliusmarminge
Copy link
Member

Closes #

βœ… Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

[Short description of what has changed]


Screenshots

[Screenshots]

πŸ’―

@vercel
Copy link

vercel bot commented Oct 11, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
create-t3-app βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Oct 15, 2023 10:19pm
t3-upgrade βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Oct 15, 2023 10:19pm

@changeset-bot
Copy link

changeset-bot bot commented Oct 11, 2023

⚠️ No Changeset found

Latest commit: 2a4799e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@juliusmarminge
Copy link
Member Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions github-actions bot added πŸ“Œ area: cli Relates to the CLI πŸ“Œ area: t3-app Relates to the generated T3 App labels Oct 11, 2023
@juliusmarminge juliusmarminge added πŸš€ autorelease add this label to a pr to trigger a beta release and removed πŸ“Œ area: cli Relates to the CLI πŸ“Œ area: t3-app Relates to the generated T3 App labels Oct 11, 2023
@github-actions
Copy link
Contributor

A new create-t3-app prerelease is available for testing. You can install this latest build in your project with:

pnpm create [email protected]

@github-actions github-actions bot removed the πŸš€ autorelease add this label to a pr to trigger a beta release label Oct 11, 2023
@juliusmarminge
Copy link
Member Author

CleanShot 2023-10-11 at 09.18.38@2x.png

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) => {
Copy link
Member Author

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)

Copy link
Member

@c-ehrlich c-ehrlich Oct 15, 2023

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?

Copy link
Member Author

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 πŸ˜…

@juliusmarminge juliusmarminge changed the title warn if nextauth url and port doesn't match feat: warn if nextauth url and port doesn't match Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
πŸ“Œ area: cli Relates to the CLI πŸ“Œ area: t3-app Relates to the generated T3 App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants