Add cookie function

This commit is contained in:
Owen Schwartz 2024-10-14 15:00:10 -04:00
parent 35abd7bb7b
commit c96f4d274a
3 changed files with 21 additions and 23 deletions

10
src/api/cookies.ts Normal file
View file

@ -0,0 +1,10 @@
import { cookies } from "next/headers";
export function authCookieHeader() {
const sessionId = cookies().get("session")?.value ?? null;
return {
headers: {
Cookie: `session=${sessionId}`
}
}
}