feat(auth): add signin/signup improvements#75
Conversation
|
@chimenemking is attempting to deploy a commit to the Joseph Owonwo's projects Team on Vercel. A member of the Team first needs to authorize it. |
- Fix email validation syntax for zod v4 (z.email instead of z.string().email) - Remove unnecessary useEffect for form reset, move logic to switchMode - Replace custom LoadingSpinner with lucide-react Loader2
|
Fixed all 3 issues. Ready for re-review 🌟 @prudentbird |
| } | ||
| }, [signUpState.success, redirectTo]); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
just render an inline alert under the form input fields only when there's a value for error. that way you can remove the rest of the useEffects..
|
|
||
| useEffect(() => { | ||
| if (signUpState.success) { | ||
| toast.success("Account created! Redirecting to onboarding..."); |
There was a problem hiding this comment.
this toast isn't necessary since user get's redirected immediately after success...
https://react.dev/reference/react/useActionState
also this redirect should probably be sent from the server action. figure out an alternative without using useEffect
There was a problem hiding this comment.
revert changes to this file, unassociated to PR
@owonwo @prudentbird @Dominion77



Changes
✅ First Name and Last Name fields
✅ Zod validation (min 2 chars for names)
✅ Loading spinner during submission
✅ Toast notifications (success/error)
✅ Form persistence (name/email stay on error)
✅ Password fields clear for security
✅ Disabled inputs during submission
Files Changed
app/auth/[[...all]]/form.tsx
components/ui/loading-spinner.tsx