// Public sign-in — URL `/login`. DEMO login: it just writes the cookie the // admin gate looks for. A real app POSTs credentials to an api that returns a // signed, HttpOnly session cookie — see AGENTS.md › Auth. import type { ReactNode } from 'react' import type { PageMeta } from '@voltro/web' import { useNavigate } from '@voltro/web' import { T } from '@voltro/i18n' import { getCatalog } from '../../../locales/index' import { SESSION_COOKIE } from '../../../lib/auth' export const renderMode = 'static' as const export const meta = ({ locale }: { readonly locale: string }): PageMeta => ({ title: getCatalog(locale)['meta.login.title'], }) export default function Login(): ReactNode { const navigate = useNavigate() const onSignIn = (): void => { document.cookie = `${SESSION_COOKIE}=ok; path=/; max-age=86400; samesite=lax` const from = new URLSearchParams(window.location.search).get('from') ?? '/admin' navigate(from) } return (

) }