Skip to content

Commit

Permalink
fix: loosen env variable URL fallback (#4443)
Browse files Browse the repository at this point in the history
Co-authored-by: Lluis Agusti <hi@llu.lu>
  • Loading branch information
balazsorban44 and ubbe-xyz committed Apr 28, 2022
1 parent bc15e28 commit d4fb7af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/next-auth/src/react/index.tsx
Expand Up @@ -47,15 +47,15 @@ export * from "./types"
// 2. When invoked server side the value is picked up from an environment
// variable and defaults to 'http://localhost:3000'.
const __NEXTAUTH: NextAuthClientConfig = {
baseUrl: parseUrl(process.env.NEXTAUTH_URL ?? process.env.VERCEL_URL).origin,
baseUrl: parseUrl(process.env.NEXTAUTH_URL || process.env.VERCEL_URL).origin,
basePath: parseUrl(process.env.NEXTAUTH_URL).path,
baseUrlServer: parseUrl(
process.env.NEXTAUTH_URL_INTERNAL ??
process.env.NEXTAUTH_URL ??
process.env.NEXTAUTH_URL_INTERNAL ||
process.env.NEXTAUTH_URL ||
process.env.VERCEL_URL
).origin,
basePathServer: parseUrl(
process.env.NEXTAUTH_URL_INTERNAL ?? process.env.NEXTAUTH_URL
process.env.NEXTAUTH_URL_INTERNAL || process.env.NEXTAUTH_URL
).path,
_lastSync: 0,
_session: undefined,
Expand Down

0 comments on commit d4fb7af

Please sign in to comment.