page.tsx40 lines · main
1import { fetchAuthCoreInfo } from './lib/auth-api';
2import { loadAuthV2Workspace } from './lib/load-workspace';
3import { AuthProjectsGrid } from './auth-projects-grid';
4
5export const metadata = { title: 'Auth' };
6export const dynamic = 'force-dynamic';
7
8/**
9 * Auth home — pick a project (same idea as the Projects dashboard).
10 * Click a card → that project's Auth only.
11 */
12export default async function AuthHomePage() {
13 const [projects, info] = await Promise.all([
14 loadAuthV2Workspace(),
15 fetchAuthCoreInfo(),
16 ]);
17
18 const enabled = projects.filter((p) => p.authEnabled).length;
19 const engine = info?.engine ?? 'briven-engine';
20 const version = info?.engineVersion ?? '';
21
22 return (
23 <section>
24 <header className="mb-6 flex flex-wrap items-end justify-between gap-3">
25 <div>
26 <h1 className="font-mono text-xl tracking-tight text-[var(--color-text)]">
27 Auth
28 </h1>
29 <p className="mt-1 font-mono text-sm text-[var(--color-text-muted)]">
30 {projects.length} project{projects.length === 1 ? '' : 's'}
31 {enabled > 0 ? ` · ${enabled} Auth on` : ''}
32 {version ? ` · ${engine} ${version}` : ''}
33 </p>
34 </div>
35 </header>
36
37 <AuthProjectsGrid projects={projects} />
38 </section>
39 );
40}