diff --git a/apps/web/app/(auth)/signin/page.tsx b/apps/web/app/(auth)/signin/page.tsx index 049865c..2435564 100644 --- a/apps/web/app/(auth)/signin/page.tsx +++ b/apps/web/app/(auth)/signin/page.tsx @@ -5,7 +5,13 @@ import { signIn } from "next-auth/react"; import { useRouter } from "next/navigation"; import Link from "next/link"; -export default function SignIn() { +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Code, ArrowLeft } from "lucide-react"; + +export default function SignInPage() { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [isLoading, setIsLoading] = useState(false); @@ -25,14 +31,14 @@ export default function SignIn() { }); if (result?.error) { - setError("Invalid credentials"); + setError("Invalid email or password. Please try again."); } else { - router.push("/"); + router.push("/dashboard"); // Redirect to dashboard on success router.refresh(); } } catch (error: unknown) { console.error("Sign in error:", error); - setError("An error occurred. Please try again."); + setError("An unexpected error occurred. Please try again."); } finally { setIsLoading(false); } @@ -40,144 +46,138 @@ export default function SignIn() { const handleOAuthSignIn = async (provider: string) => { setIsLoading(true); - await signIn(provider, { callbackUrl: "/" }); + await signIn(provider, { callbackUrl: "/dashboard" }); + // No need to setIsLoading(false) here, as the page will redirect }; return ( -
- Or{" "} - - create a new account - -
-