admin login issue

This commit is contained in:
2026-09-21 16:38:15 +05:30
parent 8456c5e852
commit b60b8baef6
40 changed files with 2254 additions and 260 deletions

View 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>
);
}

View 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>;
}