"use client"; import { signIn } from "next-auth/react"; import Link from "next/link"; import { useState } from "react"; export default function LoginPage() { const [error, setError] = useState(null); const onSubmit = async (event: React.FormEvent) => { event.preventDefault(); setError(null); const formData = new FormData(event.currentTarget); const email = formData.get("email") as string; const password = formData.get("password") as string; const result = await signIn("credentials", { email, password, redirect: true, callbackUrl: "/" }); if (result?.error) { setError("Login fehlgeschlagen."); } }; return (

Login

{error &&

{error}

}

Kein Konto? Registrieren

); }