feat : big update
CI / Verify (push) Successful in 3m14s
CI / Build immutable images and deploy (push) Successful in 4m0s

This commit is contained in:
2026-10-01 18:37:15 +07:00 Unverified
parent c5037154cb
commit 0022625edb
76 changed files with 18671 additions and 29 deletions
+9 -2
View File
@@ -52,7 +52,7 @@ function createAuth() {
secret: required("BETTER_AUTH_SECRET"),
emailAndPassword: {
enabled: true,
disableSignUp: true,
disableSignUp: false,
minPasswordLength: 12,
maxPasswordLength: 128,
},
@@ -72,7 +72,7 @@ function createAuth() {
captcha({
provider: "cloudflare-turnstile",
secretKey: required("TURNSTILE_SECRET_KEY"),
endpoints: ["/sign-in/email"],
endpoints: ["/sign-in/email", "/sign-up/email"],
}),
]),
admin({ defaultRole: "user" }),
@@ -125,3 +125,10 @@ export async function requireAdmin(): Promise<AdminSession> {
if (!session) throw new AdminAuthorizationError();
return session;
}
export const getCustomerSession = cache(async () => {
if (!hasAuthConfiguration()) return null;
const session = await getAuth().api.getSession({ headers: await headers() });
if (!session?.session) return null;
return { user: session.user, session: { id: session.session.id } };
});