"use client"; import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { signIn } from "next-auth/react"; import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card"; import { Input } from "~/components/ui/input"; import { Button } from "~/components/ui/button"; import { Label } from "~/components/ui/label"; import { toast } from "sonner"; import { Logo } from "~/components/logo"; import { Mail, Lock, ArrowRight } from "lucide-react"; export default function SignInPage() { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); async function handleSignIn(e: React.FormEvent) { e.preventDefault(); setLoading(true); const result = await signIn("credentials", { email, password, redirect: false, }); setLoading(false); if (result?.error) { toast.error("Invalid email or password"); } else { toast.success("Signed in successfully!"); router.push("/dashboard"); router.refresh(); } } return (
Sign in to your beenvoice account
Simple invoicing for freelancers and small businesses