Skip to content

feat(auth): migrate Login & Register to React Hook Form + Zod (#509)#528

Open
Rufai-Ahmed wants to merge 1 commit into
Arenax-gaming:mainfrom
Rufai-Ahmed:feat/rhf-zod-auth-forms
Open

feat(auth): migrate Login & Register to React Hook Form + Zod (#509)#528
Rufai-Ahmed wants to merge 1 commit into
Arenax-gaming:mainfrom
Rufai-Ahmed:feat/rhf-zod-auth-forms

Conversation

@Rufai-Ahmed

Copy link
Copy Markdown

Summary

Migrates the core auth forms from manual useState validation to React Hook Form + Zod, establishing a consistent, type-safe pattern for the rest of the app's forms (#509).

Changes

  • Added react-hook-form + @hookform/resolvers.
  • LoginForm and RegisterForm now use useForm + zodResolver, reusing the existing schemas in lib/validations/auth.ts (loginSchema, registerSchema) instead of hand-rolled validate()/safeParse.
  • Added a LoginFormInput type so the rememberMe default is handled correctly across Zod's input/output transform (useForm<LoginFormInput, _, LoginFormData>).
  • Preserved all existing behaviour and a11y: username-availability check, password-strength indicator, terms-agreement gate, social login, aria-invalid/aria-describedby, and error messaging.

Scope

The issue lists "all forms" plus analytics/perf/docs. This PR converts the two core auth forms as the canonical RHF+Zod template; the remaining forms (password reset, tournament registration, withdraw modal, contact) can adopt the same pattern in follow-ups.

Testing

tsc --noEmit is clean for LoginForm.tsx, RegisterForm.tsx, and validations/auth.ts. (The repo has unrelated pre-existing type errors in other areas.)

Closes #509

@Rufai-Ahmed Rufai-Ahmed requested a review from anonfedora as a code owner June 23, 2026 11:34
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@Rufai-Ahmed is attempting to deploy a commit to the paul joseph's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FRONTEND] Implement Advanced Form Validation with React Hook Form

1 participant