Files
knur-app/lib/session.ts

9 lines
235 B
TypeScript
Raw Permalink Normal View History

2026-06-18 11:02:31 +02:00
import { auth } from "@/auth";
export async function getCurrentUserId(): Promise<string> {
const session = await auth();
const id = session?.user?.id;
if (!id) throw new Error("Użytkownik nie jest zalogowany.");
return id;
}