The AdminGuard component has been added to the AccountPage, AccountsPage, and AdminPage in the web app. This server-side implementation ensures that these pages are only accessible to super-admin users. If a user is not a super-admin, the guard will trigger a redirect to a 404 page.
18 lines
429 B
TypeScript
18 lines
429 B
TypeScript
import { AdminDashboard } from '@kit/admin/components/admin-dashboard';
|
|
import { AdminGuard } from '@kit/admin/components/admin-guard';
|
|
import { PageBody, PageHeader } from '@kit/ui/page';
|
|
|
|
function AdminPage() {
|
|
return (
|
|
<>
|
|
<PageHeader title={'Admin'} description={`Your SaaS stats at a glance`} />
|
|
|
|
<PageBody>
|
|
<AdminDashboard />
|
|
</PageBody>
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default AdminGuard(AdminPage);
|