mirror of
https://github.com/YuzuZensai/Minikura.git
synced 2026-09-13 18:59:25 +00:00
🐛 fix: proxy requests through the web origin
This commit is contained in:
@@ -3,6 +3,8 @@ import { betterAuth } from "better-auth";
|
||||
import { prismaAdapter } from "better-auth/adapters/prisma";
|
||||
import { admin, openAPI } from "better-auth/plugins";
|
||||
|
||||
const webUrl = process.env.WEB_URL || "http://localhost:3001";
|
||||
|
||||
export const auth = betterAuth({
|
||||
database: prismaAdapter(prisma, {
|
||||
provider: "postgresql",
|
||||
@@ -10,11 +12,11 @@ export const auth = betterAuth({
|
||||
}),
|
||||
emailAndPassword: { enabled: true },
|
||||
plugins: [admin(), openAPI()],
|
||||
trustedOrigins: [process.env.WEB_URL || "http://localhost:3001"],
|
||||
session: {
|
||||
cookieCache: { enabled: true, maxAge: 60 * 5 },
|
||||
},
|
||||
trustedOrigins: [webUrl],
|
||||
basePath: "/auth",
|
||||
advanced: {
|
||||
useSecureCookies: webUrl.startsWith("https://"),
|
||||
},
|
||||
});
|
||||
|
||||
export type Auth = typeof auth;
|
||||
|
||||
Reference in New Issue
Block a user