'use client'; import { signIn } from 'next-auth/react'; import { useState } from 'react'; export default function SignIn() { 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('Invalid credentials'); } else { window.location.href = '/'; } } catch (err) { setError('Login failed'); } finally { setLoading(false); } }; return (

Fiscal Clone

Sign in to your account

{error && (
{error}
)}
setEmail(e.target.value)} className="w-full bg-slate-700/50 border border-slate-600 rounded-lg px-4 py-3 text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="you@example.com" required />
setPassword(e.target.value)} className="w-full bg-slate-700/50 border border-slate-600 rounded-lg px-4 py-3 text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="•••••••••" required minLength={8} />
Or continue with

Don't have an account?{' '} Sign up

); }