admin login issue
This commit is contained in:
35
src/app/(admin)/admin/page.tsx
Normal file
35
src/app/(admin)/admin/page.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import type {Metadata} from 'next';
|
||||
import {VStack} from '@astryxdesign/core/Layout';
|
||||
import {Text} from '@astryxdesign/core/Text';
|
||||
import {CompaniesPanel} from '@/features/admin/components/CompaniesPanel';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Platform admin · Loyaly',
|
||||
};
|
||||
|
||||
/**
|
||||
* The platform console.
|
||||
*
|
||||
* Company administration and nothing else — that is the whole of the platform's
|
||||
* admin surface upstream (`/api/admin/*`), and this page deliberately does not
|
||||
* grow past it. There is no endpoint to browse a tenant's visitors, cameras,
|
||||
* reports or shops, and no impersonation: seeing a company's data means signing
|
||||
* in as that company's owner, which is a different decision with a different
|
||||
* audit trail.
|
||||
*/
|
||||
export default function AdminPage() {
|
||||
return (
|
||||
<VStack gap={6} width="100%">
|
||||
<VStack gap={1}>
|
||||
<Text type="display-3" weight="medium">
|
||||
Platform admin
|
||||
</Text>
|
||||
<Text size="sm" color="secondary">
|
||||
Create, suspend and remove the merchant companies on this platform.
|
||||
</Text>
|
||||
</VStack>
|
||||
|
||||
<CompaniesPanel />
|
||||
</VStack>
|
||||
);
|
||||
}
|
||||
23
src/app/(admin)/layout.tsx
Normal file
23
src/app/(admin)/layout.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import {AdminLayout} from '@/features/admin/components/AdminLayout';
|
||||
|
||||
/**
|
||||
* The route-group boundary for the platform console.
|
||||
*
|
||||
* Deliberately NOT `(workspace)`. That group wraps everything in
|
||||
* `ProtectedLayout` → `WorkspaceShell`: a site switcher, tenant navigation and
|
||||
* the Loyaly AI rail, every one of which is scoped to a company. A platform
|
||||
* operator has no company, so that shell would render a store picker with
|
||||
* nothing in it above a page about somebody else's stores.
|
||||
*
|
||||
* What the two groups DO share is the session: `AdminLayout` uses the same
|
||||
* `AuthGuard` as the workspace, reading the same cookie minted by the same
|
||||
* login route. There is one authentication system in this app, and this is not
|
||||
* a second one.
|
||||
*/
|
||||
export default function AdminRouteLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return <AdminLayout>{children}</AdminLayout>;
|
||||
}
|
||||
Reference in New Issue
Block a user