taxonomy/lib/session.ts
2022-11-08 08:35:26 +04:00

13 lines
300 B
TypeScript

import { unstable_getServerSession } from "next-auth/next"
import { authOptions } from "@/lib/auth"
export async function getSession() {
return await unstable_getServerSession(authOptions)
}
export async function getCurrentUser() {
const session = await getSession()
return session?.user
}