Login page and Settings → eGov: relay session with a server-side challenge/nonce, QR + eGov Mobile deep link, polling, one-shot completion; IIN from the signer's certificate (own DER reader), users.egov_iin. The relay is trusted (PM decision): no own XMLDSig check. CLI peppa user egov, mock-kazeds-relay, tests. Dev mode: /_next/static is no-store (Cloudflare cached stale chunks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
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";
|
||
import { Button } from "@/components/ui/button";
|
||
|
||
export const dynamic = "force-dynamic";
|
||
|
||
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} />
|
||
<Button asChild variant="default" size="lg" className="w-full">
|
||
<a href={`/auth/start?next=${encodeURIComponent(safeNext(next))}`}>Войти через Gitea</a>
|
||
</Button>
|
||
<EgovSign purpose="login" next={safeNext(next)} label="Войти через eGov" />
|
||
<Footer />
|
||
</div>
|
||
</main>
|
||
);
|
||
}
|