import type { Metadata } from 'next'; import { redirect } from 'next/navigation'; import { LoginForm } from '@/components/admin/login-form'; import { getAdminToken } from '@/lib/admin/session'; export const metadata: Metadata = { title: 'Sign in', robots: { index: false, follow: false } }; export const dynamic = 'force-dynamic'; /** `/admin`: login form, or straight to the overview when a session cookie is present (the overview validates it). */ export default async function AdminLogin({ searchParams }: { searchParams: Promise> }) { const sp = await searchParams; const token = await getAdminToken(); if (token && !sp.expired && !sp.signed_out) redirect('/admin/overview'); const hint = sp.expired ? 'Your session expired or the token was rejected — sign in again.' : sp.signed_out ? 'Signed out.' : null; return (

AI Atlas

Admin console

Connectors, runs, documents, jobs, review queue and infrastructure. Restricted to operators.

); }