v1.6.0: Admin-Passwort-Reset, Login per Nachname, Default-PW-Sperre

This commit is contained in:
2026-05-11 12:20:44 +02:00
parent 4d84b8f718
commit 0ea960259c
12 changed files with 195 additions and 15 deletions
+6 -6
View File
@@ -8,23 +8,23 @@ export async function login(
_prevState: { error: string } | undefined,
formData: FormData
): Promise<{ error: string }> {
const kuerzel = (formData.get('username') as string)?.trim();
const login = (formData.get('username') as string)?.trim();
const password = formData.get('password') as string;
if (!kuerzel || !password) {
return { error: 'Bitte Kürzel und Passwort eingeben.' };
if (!login || !password) {
return { error: 'Bitte Kürzel/Nachname und Passwort eingeben.' };
}
const result = await verifyCredentials(kuerzel, password);
const result = await verifyCredentials(login, password);
if (!result || !result.valid) {
return { error: 'Ungültiges Kürzel oder Passwort.' };
return { error: 'Ungültiger Benutzername oder Passwort.' };
}
const mustChange = result.beo.MustChangePassword === 1 || !result.beo.pw;
await createSession({
kuerzel: result.beo.kürzel ?? kuerzel,
kuerzel: result.beo.kürzel ?? login,
beoId: result.beo.id,
beoName: getBeoDisplayName(result.beo),
mustChangePassword: mustChange,