diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx index a2e99cd..d7d9bfb 100644 --- a/app/(auth)/login/page.tsx +++ b/app/(auth)/login/page.tsx @@ -375,33 +375,14 @@ function LoginContent() { {/* Heading */}

{step === "login" && "Welcome back"} - {step === "signup" && "Create an account"} {step === "verify" && "Verify your email"}

{/* Subtitle */} {step === "login" && (

- New to Attune Heart Therapy?{" "} - - Sign up - + Sign in to access your admin dashboard

)} - {step === "signup" && ( -

- Already have an account?{" "} - -

- )} {step === "verify" && registeredEmail && (

We've sent a verification code to {registeredEmail} @@ -519,168 +500,6 @@ function LoginContent() { )} - {/* Signup Form */} - {step === "signup" && ( -

- {/* First Name Field */} -
- - handleSignupChange("first_name", e.target.value)} - className={`h-11 ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'} ${errors.first_name ? 'border-red-500' : ''}`} - required - /> - {errors.first_name && ( -

{errors.first_name}

- )} -
- - {/* Last Name Field */} -
- - handleSignupChange("last_name", e.target.value)} - className={`h-11 ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'} ${errors.last_name ? 'border-red-500' : ''}`} - required - /> - {errors.last_name && ( -

{errors.last_name}

- )} -
- - {/* Email Field */} -
- - handleSignupChange("email", e.target.value)} - className={`h-11 ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'} ${errors.email ? 'border-red-500' : ''}`} - required - /> - {errors.email && ( -

{errors.email}

- )} -
- - {/* Phone Field */} -
- - handleSignupChange("phone_number", e.target.value)} - className={`h-11 ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'}`} - /> -
- - {/* Password Field */} -
- -
- handleSignupChange("password", e.target.value)} - className={`h-11 pr-12 ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'} ${errors.password ? 'border-red-500' : ''}`} - required - /> - -
- {errors.password && ( -

{errors.password}

- )} -
- - {/* Confirm Password Field */} -
- -
- handleSignupChange("password2", e.target.value)} - className={`h-11 pr-12 ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'} ${errors.password2 ? 'border-red-500' : ''}`} - required - /> - -
- {errors.password2 && ( -

{errors.password2}

- )} -
- - {/* Submit Button */} - -
- )} {/* OTP Verification Form */} {step === "verify" && ( @@ -775,17 +594,17 @@ function LoginContent() { )} - {/* Back to signup */} + {/* Back to login */}
diff --git a/components/LoginDialog.tsx b/components/LoginDialog.tsx index 7d08c78..ab1ddf0 100644 --- a/components/LoginDialog.tsx +++ b/components/LoginDialog.tsx @@ -55,7 +55,7 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP const validation = loginSchema.safeParse(loginData); if (!validation.success) { const firstError = validation.error.issues[0]; - setError(firstError.message); + toast.error(firstError.message); return; } @@ -64,13 +64,12 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP if (result.tokens && result.user) { toast.success("Login successful!"); - setShowPassword(false); - onOpenChange(false); - onLoginSuccess(); + setShowPassword(false); + onOpenChange(false); + onLoginSuccess(); } } catch (err) { const errorMessage = err instanceof Error ? err.message : "Login failed. Please try again."; - setError(errorMessage); toast.error(errorMessage); } }; @@ -83,7 +82,7 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP const validation = registerSchema.safeParse(signupData); if (!validation.success) { const firstError = validation.error.issues[0]; - setError(firstError.message); + toast.error(firstError.message); return; } @@ -106,7 +105,6 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP } } catch (err) { const errorMessage = err instanceof Error ? err.message : "Signup failed. Please try again."; - setError(errorMessage); toast.error(errorMessage); } }; @@ -160,14 +158,9 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP {/* Scrollable Content */}
- {/* Signup Form */} - {isSignup ? ( + {/* Signup Form */} + {isSignup ? (
- {error && ( -
-

{error}

-
- )} {/* First Name Field */}
@@ -183,7 +176,7 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP className={`h-11 sm:h-12 text-sm sm:text-base ${isDark ? 'bg-gray-700 border-gray-600 text-white placeholder:text-gray-400' : 'bg-white border-gray-300 text-gray-900'}`} required /> -
+
{/* Last Name Field */}
@@ -327,11 +320,6 @@ export function LoginDialog({ open, onOpenChange, onLoginSuccess }: LoginDialogP ) : ( /* Login Form */ - {error && ( -
-

{error}

-
- )} {/* Email Field */}