This commit is contained in:
Dominik Klarkowski
2026-06-18 11:02:31 +02:00
parent d00a5a42ac
commit 047e580da0
32 changed files with 735 additions and 189 deletions

8
lib/session.ts Normal file
View File

@@ -0,0 +1,8 @@
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;
}