peppa/apps/web/app/login/page.tsx
Асель 358fb5c0e9 PEP-66: «стори» and «эпики» in web, bot, notifications, MCP texts, help; tab tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 03:28:42 +05:00

41 lines
2.2 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";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
export const dynamic = "force-dynamic";
export default async function Login({ searchParams }: { searchParams: Promise<{ error?: string; next?: string; login?: string }> }) {
const { error, next, login } = 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" />
<div className="flex w-full items-center gap-3 text-xs text-muted-foreground">
<span className="h-px flex-1 bg-border" />
или по логину Пеппы
<span className="h-px flex-1 bg-border" />
</div>
<form action="/auth/password" method="post" className="flex w-full flex-col gap-2" aria-label="Вход по логину и паролю">
<input type="hidden" name="next" value={safeNext(next)} />
<Input name="login" placeholder="Логин" aria-label="Логин" autoComplete="username" autoCapitalize="none" spellCheck={false} required defaultValue={login ?? ""} />
<Input name="password" type="password" placeholder="Пароль" aria-label="Пароль" autoComplete="current-password" required />
<Button size="lg" className="w-full">Войти</Button>
</form>
<Footer />
</div>
</main>
);
}