Skip to content

fix: add client-side form validation to login and signup pages#250

Open
Ananya-CM wants to merge 1 commit into
Shriii19:masterfrom
Ananya-CM:fix/client-side-form-validation
Open

fix: add client-side form validation to login and signup pages#250
Ananya-CM wants to merge 1 commit into
Shriii19:masterfrom
Ananya-CM:fix/client-side-form-validation

Conversation

@Ananya-CM

@Ananya-CM Ananya-CM commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Added real-time client-side validation to Login
and Signup pages using Zod schemas. Previously
users had to wait for server round-trips to see
errors for obviously invalid inputs.

Changes Made

frontend/app/login/page.tsx

  • Added emailError and passwordError states
  • Added validateEmail() using Zod email schema
  • Added validatePassword() using Zod min(8) schema
  • Email and password inputs now validate on onBlur
  • Inline red error messages shown under each field
  • Login button disabled until both fields pass
    validation (isFormValid check)

frontend/app/signup/page.tsx

  • Added emailError, usernameError,
    passwordStrength states
  • validateEmailField() uses existing
    signupSchema.shape.email from auth.ts
  • validateUsernameField() uses existing
    signupSchema.shape.username from auth.ts
  • Username and email inputs validate on onBlur
  • Added real-time password strength indicator
    (Weak / Medium / Strong) with colored bars
  • Inline red error messages shown under fields

Before

  • No inline validation — user had to submit
    form to see errors
  • No real-time feedback while typing
  • Unnecessary API calls for invalid inputs

After

  • ✅ Inline errors appear on field blur
  • ✅ Login button disabled for invalid inputs
  • ✅ Password strength bar (red/yellow/green)
  • ✅ Uses existing Zod schemas from auth.ts

Screenshots

image image

Files Changed

  • frontend/app/login/page.tsx
  • frontend/app/signup/page.tsx

Issue

Closes #99

nsoc26

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@Ananya-CM is attempting to deploy a commit to the shreemp194-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

👋 Thank you for opening this pull request! I will review your changes and assist you soon.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flow-forge Error Error Jun 11, 2026 5:59pm

…side form validation to login and signup pages [nsoc26]
@Shriii19

Copy link
Copy Markdown
Owner

@Ananya-CM it have the deployment error so it ASAP.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Add Client-Side Form Validation to Login and Signup Pages

2 participants