diff --git a/apps/editor/lib/auth.ts b/apps/editor/lib/auth.ts index 5cf5a59b..c71a7363 100644 --- a/apps/editor/lib/auth.ts +++ b/apps/editor/lib/auth.ts @@ -7,19 +7,11 @@ import { BASE_URL } from './utils' const resendApiKey = process.env.RESEND_API_KEY const resend = resendApiKey && resendApiKey.trim() !== '' ? new Resend(resendApiKey) : null -// Better Auth secret is required -const betterAuthSecret = process.env.BETTER_AUTH_SECRET -if (!betterAuthSecret) { - throw new Error( - 'Missing BETTER_AUTH_SECRET environment variable. Generate one with: openssl rand -base64 32', - ) -} - export const auth = createAuth({ db, appName: 'Pascal Editor', baseURL: BASE_URL, - secret: betterAuthSecret, + secret: process.env.BETTER_AUTH_SECRET!, sendMagicLink: async ({ email, url }) => { if (!resend) { console.log(`[DEV] Magic link for ${email}: ${url}`)