mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
migration
This commit is contained in:
@@ -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}</>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user