Fix cookie secure flag for HTTP

This commit is contained in:
Karol Głowacki
2026-01-09 19:41:43 +01:00
parent 4c35197231
commit 7abc9eba19

View File

@@ -34,9 +34,10 @@ export async function POST(request: NextRequest) {
const response = NextResponse.json({ success: true });
response.cookies.set("auth-token", token, {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
secure: false, // Allow HTTP for local/internal deployments
sameSite: "lax",
maxAge: 60 * 60 * 24 * 7, // 7 days
path: "/",
});
console.log("[LOGIN] Cookie set, returning success");