peppa/apps/web/app/login/page.tsx
Асель a1b3760afd PEP-72: eGov sign-in on the phone itself through the deep link
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 18:15:34 +05:00

27 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { redirect } from "next/navigation";
import { currentUser, safeNext } from "@/lib/auth";
import { Brand } from "@/components/Brand";
import { Flash } from "@/components/common";
import { EgovSign } from "@/components/EgovSign";
import { Footer } from "@/components/Footer";
export const dynamic = "force-dynamic";
/** PEP-71: eGov QR is the only way in; the first login registers the account. */
export default async function Login({ searchParams }: { searchParams: Promise<{ error?: string; next?: string }> }) {
const { error, next } = await searchParams;
if (await currentUser()) redirect(safeNext(next));
return (
<main className="grid min-h-dvh place-items-center px-4">
<div className="flex w-full max-w-sm flex-col items-center gap-5 text-center">
<Brand large />
<p className="m-0 text-sm text-muted-foreground">Софтвейр-фабрика: проекты в Gitea, стори по OpenSpec, агенты Claude Code и Codex.</p>
<Flash error={error} />
<EgovSign purpose="login" next={safeNext(next)} label="Войти через eGov" />
<p className="m-0 text-xs text-muted-foreground">Первый вход сразу создаёт учётку по вашему ИИН. На телефоне вход открывает eGov Mobile, QR не нужен.</p>
<Footer />
</div>
</main>
);
}