Wrap admin pages with AdminGuard component
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.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { AdminGuard } from '@kit/admin/components/admin-guard';
|
||||
import { PageBody, PageHeader } from '@kit/ui/page';
|
||||
|
||||
export default function AccountsPage() {
|
||||
function AccountsPage() {
|
||||
return (
|
||||
<>
|
||||
<PageHeader title={'Accounts'} />
|
||||
@@ -8,3 +9,5 @@ export default function AccountsPage() {
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default AdminGuard(AccountsPage);
|
||||
|
||||
Reference in New Issue
Block a user