"use client"; import { useState } from "react"; import { authClient } from "@/lib/auth-client"; import { useRouter } from "next/navigation"; import Link from "next/link"; export default function SignInPage() { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const handleSignIn = async (e: React.FormEvent) => { e.preventDefault(); setError(""); setLoading(true); try { const result = await authClient.signIn.email({ email, password, }); if (result.error) { setError(result.error.message ?? "Anmeldung fehlgeschlagen"); } else { router.push("/dashboard"); } } catch { setError("Ein unerwarteter Fehler ist aufgetreten"); } finally { setLoading(false); } }; return (

Willkommen zurück 🍋

Melde dich bei LemonSpace an

setEmail(e.target.value)} required className="w-full rounded-lg border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary" placeholder="name@beispiel.de" />
setPassword(e.target.value)} required className="w-full rounded-lg border bg-background px-3 py-2 text-sm outline-none focus:ring-2 focus:ring-primary" placeholder="Dein Passwort" />
{error && (

{error}

)}

Noch kein Konto?{" "} Registrieren

); }