"use client" import { useState } from "react" import { signIn } from "next-auth/react" import { useRouter } from "next/navigation" import Link from "next/link" export default function LoginPage() { const [email, setEmail] = useState("") const [password, setPassword] = useState("") const [error, setError] = useState("") const [loading, setLoading] = useState(false) const router = useRouter() const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError("") setLoading(true) const result = await signIn("credentials", { email, password, redirect: false, }) if (result?.error) { setError("Invalid email or password") setLoading(false) } else { router.push("/dashboard") } } return (
Sign in to your charity dashboard
Don't have an account?{" "} Get Started Free