import { cookies } from "next/headers";
import { verifySession } from "./jwt";

export const SESSION_COOKIE = "ep_session";

export async function getSession() {
  const cookieStore = await cookies();
  const c = cookieStore.get(SESSION_COOKIE)?.value;
  if (!c) return null;
  return await verifySession(c);
}
