CoastalCommitsPastes/client/lib/server/session.ts
Max Leiter 12d9eafcd9 lint
2022-11-17 22:36:53 -08:00

12 lines
292 B
TypeScript

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
}