From 1c5b1e99b64981601f1a7dc7e0afc27891cb8c7e Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 22:07:28 +0000 Subject: [PATCH] Fix: Dashboard blank and no ports --- INSTALL.md | 13 ++++------ src/pages/Login.tsx | 60 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 16 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 8816ef0..1eed375 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -30,14 +30,11 @@ docker-compose up -d --build ## 4. Create Admin Account 1. Open browser: `http://your-server-ip:8080` -2. Go to Settings page -3. Click "Sign Up" -4. Use the **exact credentials** from your `.env` file -5. Submit to create admin account - -## 5. Login - -Return to login page and sign in with your credentials. +2. Click "First time? Create admin account" +3. Enter your credentials from the `.env` file +4. Click "Create Admin Account" +5. Once created, click "Already have an account? Sign in" +6. Login with your credentials --- diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 464fdb6..f080919 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -11,6 +11,7 @@ const Login = () => { const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); + const [isSignup, setIsSignup] = useState(false); const navigate = useNavigate(); const { toast } = useToast(); @@ -38,6 +39,35 @@ const Login = () => { } }; + const handleSignup = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + + try { + const { error } = await supabase.auth.signUp({ + email, + password, + }); + + if (error) throw error; + + toast({ + title: "Admin account created", + description: "You can now sign in with your credentials", + }); + + setIsSignup(false); + } catch (error: any) { + toast({ + title: "Signup failed", + description: error.message, + variant: "destructive", + }); + } finally { + setLoading(false); + } + }; + return (