"use client"; import { useState, useTransition } from "react"; import { signIn } from "next-auth/react"; import { useRouter } from "next/navigation"; export default function LoginForm({ dict, lang }: { dict: any; lang: string }) { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [isPending, startTransition] = useTransition(); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); setError(""); startTransition(async () => { const res = await signIn("credentials", { email, password, redirect: false, }); if (res?.error) { setError("E-posta veya şifre hatalı."); // We can translate this later } else { router.push(`/${lang}/dashboard`); router.refresh(); } }); }; return (
{dict.subtitle || "Mail sunucunuzu kolayca yönetin"}
AyrisTech © {new Date().getFullYear()} — Tüm hakları saklıdır.