mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-04-20 03:50:20 +00:00
16 lines
356 B
TypeScript
16 lines
356 B
TypeScript
"use server";
|
|
import { headers } from "next/headers";
|
|
import { cache } from "react";
|
|
import { auth } from "../app/auth";
|
|
|
|
const getCurrentUserCache = cache(async () => {
|
|
const session = await auth.api.getSession({
|
|
headers: await headers(),
|
|
});
|
|
return session?.user;
|
|
});
|
|
|
|
export async function getCurrentUser() {
|
|
return await getCurrentUserCache();
|
|
}
|