fix: bad cookie name with https

This commit is contained in:
Théo LAGACHE
2026-01-16 12:15:18 +01:00
parent 29718d2a0c
commit 8158934cb9
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -41,3 +41,5 @@ public/uploads/*
private/uploads/*
/.env
certificates
+2 -2
View File
@@ -8,8 +8,8 @@ import {CardAuth} from "@/features/layout/card-auth";
export default async function GuardPage() {
const cookieStore = await cookies();
const token = cookieStore.get("better-auth.two_factor")?.value;
const token = cookieStore.get("better-auth.two_factor")?.value || cookieStore.get("__Secure-better-auth.two_factor")?.value;
if (!token) {
redirect("/login");
}