add login portal and traefik middleware auth for testing redirect login

This commit is contained in:
Milo Schwartz 2024-10-06 18:08:26 -04:00
parent 0838679120
commit 87c4fc798f
No known key found for this signature in database
14 changed files with 285 additions and 130 deletions

8
src/lib/verifySession.ts Normal file
View file

@ -0,0 +1,8 @@
import { cookies } from "next/headers";
import lucia from "@server/auth";
export async function verifySession() {
const sessionId = cookies().get(lucia.sessionCookieName)?.value ?? null;
const session = await lucia.validateSession(sessionId || "");
return session;
}