import { auth } from "@/auth"; export async function getCurrentUserId(): Promise { const session = await auth(); const id = session?.user?.id; if (!id) throw new Error("Użytkownik nie jest zalogowany."); return id; }