"use client"; import { useState, useTransition } from "react"; import { signIn } from "next-auth/react"; import { useRouter } from "next/navigation"; export default function LoginPage() { 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ı."); } else { router.push("/dashboard"); router.refresh(); } }); }; return (
Mail sunucunuzu kolayca yönetin
AyrisTech © {new Date().getFullYear()} — Tüm hakları saklıdır.