This commit is contained in:
sam 2024-09-11 19:13:54 +02:00
parent 4ac0001795
commit 414e1c6107
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
5 changed files with 191 additions and 45 deletions

View file

@ -39,6 +39,8 @@ export default async function serverRequest<T>(
return (await resp.json()) as T;
}
export const getToken = (req: Request) => getCookie(req, "pronounscc-token");
export function getCookie(req: Request, cookieName: string): string | undefined {
const header = req.headers.get("Cookie");
if (!header) return undefined;