'use client'; import { signIn } from '@/lib/better-auth'; 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.email({ email, password, }); if (result.error) { setError(result.error.message || 'Invalid credentials'); } else { window.location.href = '/'; } } catch (err) { setError('Login failed'); } finally { setLoading(false); } }; const handleSocialSignIn = async (provider: 'github' | 'google') => { try { await signIn.social({ provider, callbackURL: '/', }); } catch (err) { setError(`Failed to sign in with ${provider}`); } }; 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

); }