lemmy-ui/src/server/utils/has-jwt-cookie.ts

7 lines
201 B
TypeScript
Raw Normal View History

2023-06-30 14:04:01 +00:00
import * as cookie from "cookie";
import type { Request } from "express";
export function hasJwtCookie(req: Request): boolean {
return Boolean(cookie.parse(req.headers.cookie ?? "").jwt?.length);
}