CoastalCommitsPastes/client/lib/server/session.ts

13 lines
292 B
TypeScript
Raw Normal View History

import { unstable_getServerSession } from "next-auth/next"
import { authOptions } from "./auth"
export async function getSession() {
2022-11-18 01:36:53 -05:00
return await unstable_getServerSession(authOptions)
}
export async function getCurrentUser() {
2022-11-18 01:36:53 -05:00
const session = await getSession()
2022-11-18 01:36:53 -05:00
return session?.user
}