auth: simplify admin login for local development
This commit is contained in:
parent
5264cccb6c
commit
bf42037619
3 changed files with 22 additions and 27 deletions
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue