generated from fahricansecer/boilerplate-fe
This commit is contained in:
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
|
||||
import { signIn } from "next-auth/react";
|
||||
import { motion } from "framer-motion";
|
||||
import { Sparkles, Mail, Lock, Loader2, ArrowRight } from "lucide-react";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
export default function SignInPage() {
|
||||
const router = useRouter();
|
||||
@@ -12,6 +13,7 @@ export default function SignInPage() {
|
||||
const [password, setPassword] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
@@ -35,6 +37,7 @@ export default function SignInPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
queryClient.clear();
|
||||
router.replace("/dashboard");
|
||||
} catch {
|
||||
setError("Bağlantı hatası. Lütfen tekrar deneyin.");
|
||||
|
||||
Reference in New Issue
Block a user