mirror of https://github.com/MaxLeiter/Drift
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
344 B
TypeScript
20 lines
344 B
TypeScript
import Admin from "./components/admin"
|
|
import { getCurrentUser } from "@lib/server/session"
|
|
import { notFound } from "next/navigation"
|
|
|
|
const AdminPage = async () => {
|
|
const user = await getCurrentUser()
|
|
|
|
if (!user) {
|
|
return notFound()
|
|
}
|
|
|
|
if (user.role !== "admin") {
|
|
return notFound()
|
|
}
|
|
|
|
return <Admin />
|
|
}
|
|
|
|
export default AdminPage
|