From 7acd1189ee32ec779668dd4cad725312520a14a9 Mon Sep 17 00:00:00 2001 From: i701 Date: Wed, 25 Dec 2024 22:57:54 +0500 Subject: [PATCH] swap trusted origins for .env variables --- lib/auth.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/auth.ts b/lib/auth.ts index 07c2772..ef94605 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -6,7 +6,9 @@ import { phoneNumber } from "better-auth/plugins"; const prisma = new PrismaClient(); export const auth = betterAuth({ - trustedOrigins: ["http://localhost:3000", "http://192.168.18.194:3000"], + trustedOrigins: process.env.BETTER_AUTH_TRUSTED_ORIGINS?.split(",") || [ + "localhost:3000", + ], user: { additionalFields: { role: {