25 lines
620 B
TypeScript
25 lines
620 B
TypeScript
import { getServerSession } from "next-auth/next";
|
|
import { authOptions } from "@/app/api/auth/[...nextauth]/route";
|
|
import { redirect } from "next/navigation";
|
|
import { UsersTable } from "@/components/users/users-table";
|
|
|
|
export const metadata = {
|
|
title: "Enkun - Utilisateurs",
|
|
};
|
|
|
|
export default async function UsersPage() {
|
|
const session = await getServerSession(authOptions);
|
|
|
|
if (!session) {
|
|
redirect("/signin");
|
|
}
|
|
|
|
console.log("Page session:", session); // Debug log
|
|
|
|
return (
|
|
<div className='container mx-auto py-10'>
|
|
<UsersTable userRole={session.user.role || []} />
|
|
</div>
|
|
);
|
|
}
|