CoastalCommitsPastes/client/lib/server/session.ts

15 lines
297 B
TypeScript
Raw Normal View History

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