V 1.2.2 Login-Seite: bcrypt-Passwörter, Passwort-Toggle, Footer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-25 09:21:38 +02:00
parent 8bfc2b685b
commit 325c07b469
6 changed files with 107 additions and 24 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import { verifyCredentials } from '@/lib/auth';
import { createSession, deleteSession } from '@/lib/session';
import { redirect } from 'next/navigation';
export async function login(prevState: any, formData: FormData) {
export async function login(prevState: { error: string } | null | undefined, formData: FormData) {
const username = formData.get('username') as string;
const password = formData.get('password') as string;
@@ -12,7 +12,7 @@ export async function login(prevState: any, formData: FormData) {
return { error: 'Bitte Benutzername und Passwort eingeben' };
}
const isValid = verifyCredentials(username, password);
const isValid = await verifyCredentials(username, password);
if (!isValid) {
return { error: 'Ungültige Anmeldedaten' };
}