migration

This commit is contained in:
Théo LAGACHE
2025-05-16 15:54:17 +02:00
parent 01019fe1a3
commit 6f2523e524
285 changed files with 15492 additions and 46090 deletions
+9 -13
View File
@@ -1,17 +1,13 @@
import React from "react";
import {currentUser, requiredCurrentUser} from "@/auth/current-user";
import {notFound} from "next/navigation";
import { notFound } from "next/navigation";
import { currentUser } from "@/lib/auth/current-user";
export default async function Layout({children}: { children: React.ReactNode }) {
export default async function Layout({ children }: { children: React.ReactNode }) {
const user = await currentUser();
const user = await requiredCurrentUser()
if(user.role != "admin"){
notFound()
if (user!.role !== "superadmin" && user!.role !== "admin") {
notFound();
}
return (
<>
{children}
</>
)
}
return <>{children}</>;
}