mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-06-29 13:43:58 +00:00
temporary fix for build and remove previous auth related code
This commit is contained in:
@ -1,14 +0,0 @@
|
||||
"use server";
|
||||
import { auth } from "@/app/auth";
|
||||
import { headers } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export async function AdminAuthGuard() {
|
||||
const session = await auth.api.getSession({
|
||||
headers: await headers(),
|
||||
});
|
||||
if (session?.user.role !== "ADMIN") {
|
||||
return redirect("/login");
|
||||
}
|
||||
return true;
|
||||
}
|
Reference in New Issue
Block a user