import { login, logout } from "@/actions/auth"; // The query string is attacker-controlled, so the login page renders a message // looked up by code rather than whatever text ?error= carries. Reflecting the // raw parameter let anyone put arbitrary wording ("Ihr Konto wurde gesperrt, // rufen Sie …") on the real, correctly-branded sign-in screen. const ERROR_MESSAGES = { no_hr_access: "Kein HR-Zugriff. Bitte wenden Sie sich an eine:n bestehende:n HR-Benutzer:in.", invalid_credentials: "E-Mail oder Passwort ist falsch.", } as const; type ErrorCode = keyof typeof ERROR_MESSAGES; type LoginPageProps = { searchParams: Promise<{ error?: string }>; }; export default async function LoginPage({ searchParams }: LoginPageProps) { const params = await searchParams; const code = params.error && Object.hasOwn(ERROR_MESSAGES, params.error) ? (params.error as ErrorCode) : null; const error = code ? ERROR_MESSAGES[code] : null; return (
Melden Sie sich mit Ihrem Firmenkonto an.
{error && (