auth: simplify admin login for local development

This commit is contained in:
Syahdan 2026-04-29 18:10:22 +07:00
parent 5264cccb6c
commit bf42037619
3 changed files with 22 additions and 27 deletions

View file

@ -6,6 +6,7 @@ import { drizzleAdapter } from "better-auth/adapters/drizzle";
export function createAuth() {
const db = createDb();
const isProduction = env.NODE_ENV === "production";
return betterAuth({
database: drizzleAdapter(db, {
@ -21,8 +22,8 @@ export function createAuth() {
baseURL: env.BETTER_AUTH_URL,
advanced: {
defaultCookieAttributes: {
sameSite: "none",
secure: true,
sameSite: isProduction ? "none" : "lax",
secure: isProduction,
httpOnly: true,
},
},