+
+
+
+ Welcome back
+
+
Sign in to access your workspace
-
-
-
-
+
+
+ Sign In
+ Enter your credentials to continue
+
+
+ {error && (
+
+ )}
+
+
+
+
-
-
- Or continue with
-
+
+
+
+
-
-
-
-
-
-
-
-
-
+ Sign up
+
+
+
+
+
);
}
+
+export default dynamic(() => Promise.resolve(SignInPage), { ssr: false });
diff --git a/apps/web/app/(auth)/signup/page.tsx b/apps/web/app/(auth)/signup/page.tsx
index 457015d..5649b62 100644
--- a/apps/web/app/(auth)/signup/page.tsx
+++ b/apps/web/app/(auth)/signup/page.tsx
@@ -4,8 +4,13 @@ import { useState } from "react";
import { signIn } from "next-auth/react";
import { useRouter } from "next/navigation";
import Link from "next/link";
+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, Mail, Lock, User, Loader2, CheckCircle } from "lucide-react";
-export default function SignUp() {
+export default function SignUpPage() {
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [password, setPassword] = useState("");
@@ -27,6 +32,12 @@ export default function SignUp() {
return;
}
+ if (password.length < 8) {
+ setError("Password must be at least 8 characters long");
+ setIsLoading(false);
+ return;
+ }
+
try {
const response = await fetch("/api/auth/register", {
method: "POST",
@@ -44,206 +55,235 @@ export default function SignUp() {
const data = await response.json();
if (!response.ok) {
- setError(data.error || "An error occurred");
+ setError(data.error || "An error occurred during registration.");
return;
}
- setSuccess("Account created successfully! You can now sign in.");
+ setSuccess("Account created successfully! Redirecting to sign in...");
- // Optionally auto-sign in the user
setTimeout(() => {
router.push("/signin");
}, 2000);
} catch (error: unknown) {
console.error("Sign up error:", error);
- setError("An error occurred. Please try again.");
+ setError("An unexpected error occurred. Please try again.");
} finally {
setIsLoading(false);
}
};
- const handleOAuthSignIn = async (provider: string) => {
- setIsLoading(true);
- await signIn(provider, { callbackUrl: "/" });
- };
-
return (
-
-
-
-
- Create your account
-
-
- Or{" "}
-
- sign in to your existing account
+
+ {/* Animated Background */}
+
+
+
+ {/* Header */}
+
+
+
+
+
+
+
+
Dev8.dev
-
+
+
-