Skip to content

Commit

Permalink
fix: make NEXTAUTH_URL optional
Browse files Browse the repository at this point in the history
  • Loading branch information
shadcn committed Apr 29, 2023
1 parent 54147ad commit 428b126
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { z } from "zod"

export const env = createEnv({
server: {
NEXTAUTH_URL: z.string().url(),
// This is optional because it's only used in development.
// See https://next-auth.js.org/deployment.
NEXTAUTH_URL: z.string().url().optional(),
NEXTAUTH_SECRET: z.string().min(1),
GITHUB_CLIENT_ID: z.string().min(1),
GITHUB_CLIENT_SECRET: z.string().min(1),
Expand All @@ -21,9 +23,7 @@ export const env = createEnv({
NEXT_PUBLIC_APP_URL: z.string().min(1),
},
runtimeEnv: {
NEXTAUTH_URL: process.env.VERCEL
? process.env.VERCEL_URL
: process.env.NEXTAUTH_URL,
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
GITHUB_CLIENT_ID: process.env.GITHUB_CLIENT_ID,
GITHUB_CLIENT_SECRET: process.env.GITHUB_CLIENT_SECRET,
Expand Down

0 comments on commit 428b126

Please sign in to comment.