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:
@@ -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' };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user