"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 (
Melde dich bei LemonSpace an
Noch kein Konto?{" "} Registrieren