Files

27 lines
665 B
TypeScript
Raw Permalink Normal View History

2026-01-21 18:13:35 +01:00
import { redirect } from 'next/navigation';
import { getCurrentUser } from '@/lib/auth';
2026-01-22 18:53:23 +01:00
import { hasPageAccess } from '@/lib/permissions';
2026-01-21 18:13:35 +01:00
import DashboardLayout from '@/components/DashboardLayout';
import Messagerie from '@/components/Messagerie';
export default async function MessageriePage() {
const user = await getCurrentUser();
if (!user) {
redirect('/login');
}
2026-01-22 18:53:23 +01:00
const hasAccess = await hasPageAccess(user.id, '/dashboard/messagerie');
if (!hasAccess) {
redirect('/dashboard/parametres');
}
2026-01-21 18:13:35 +01:00
return (
<DashboardLayout user={user}>
<div className="h-full">
<Messagerie />
</div>
</DashboardLayout>
);
}