2022-11-11 22:17:44 -05:00
|
|
|
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)
|
2022-11-11 22:17:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getCurrentUser() {
|
2022-11-18 01:36:53 -05:00
|
|
|
const session = await getSession()
|
2022-11-11 22:17:44 -05:00
|
|
|
|
2022-11-18 01:36:53 -05:00
|
|
|
return session?.user
|
2022-11-11 22:17:44 -05:00
|
|
|
}
|