added utils for unauth, verify, and response

This commit is contained in:
Milo Schwartz 2024-10-02 20:42:50 -04:00
parent 905cfaea34
commit 859abcf296
11 changed files with 125 additions and 69 deletions

View file

@ -0,0 +1,9 @@
import { Request } from "express";
import { lucia } from "@server/auth";
export async function verifySession(req: Request) {
const res = await lucia.validateSession(
req.cookies[lucia.sessionCookieName],
);
return res;
}