Next.js Discord

Discord Forum

Override NEXAUTH_URL in NextAuth options config?

Oak rough bulletgall wasp posted this in #help-forum
Open in Discord
Oak rough bulletgall waspOP
I have multiple environments (not just dev and prod) and they all have different canonical URLs, I was just replacing the NEXTAUTH_URL via my release pipeline in the .env.production, but after my latest changes, i need the URL set at build time. However, if I set it in the .env.production I can no longer replace it with the correct one during release. Is there any way I can set the NEXTAUTH_URL similar to how I can set the secret in the options?

3 Replies

DirtyCajunRice | AppDir
yep. look at the docs. its in the config
Oak rough bulletgall waspOP
Docs mention nothing about it
I’ve looked and looked.