mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-06-29 13:43:58 +00:00
refactor: streamline authentication flow by removing unused code, replacing custom auth utilities with NextAuth, and updating session handling in components
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 5m56s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 5m56s
This commit is contained in:
@ -1,15 +0,0 @@
|
||||
"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();
|
||||
}
|
Reference in New Issue
Block a user