Add cookie function

This commit is contained in:
Owen Schwartz 2024-10-14 15:00:10 -04:00
parent 1f0b18d496
commit 0f3dada6cc
No known key found for this signature in database
GPG key ID: 8271FDFFD9E0CCBD
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}`
}
}
}