// app/login/page.tsx "use client" import { signIn } from "next-auth/react" import { useSearchParams, useRouter } from "next/navigation" import { Suspense, useState } from "react" import Link from "next/link" function LoginForm() { const router = useRouter() const searchParams = useSearchParams() const callbackUrl = searchParams.get("callbackUrl") || "/dashboard" const [email, setEmail] = useState("") const [password, setPassword] = useState("") const [loading, setLoading] = useState(false) const [error, setError] = useState("") const handleCredentialsLogin = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError("") try { const result = await signIn("credentials", { email, password, redirect: false }) if (result?.error) { setError("Email ou senha incorretos") } else { router.push(callbackUrl) } } catch (err) { setError("Erro ao fazer login") } finally { setLoading(false) } } const handleGoogleLogin = () => { signIn("google", { callbackUrl }) } return (

🚀 PDIMaker

Plataforma de Desenvolvimento Individual

setEmail(e.target.value)} required style={{ width: "100%", padding: "0.75rem", border: "1px solid #e2e8f0", borderRadius: "0.375rem", fontSize: "1rem" }} />
setPassword(e.target.value)} required style={{ width: "100%", padding: "0.75rem", border: "1px solid #e2e8f0", borderRadius: "0.375rem", fontSize: "1rem" }} />
{error && (
{error}
)}
Não tem uma conta?{" "} Criar conta
ou

Powered By{" "} Sergio Correa

) } export default function LoginPage() { return ( Carregando...
}> ) }