cms icon indicating copy to clipboard operation
cms copied to clipboard

Fix: display validation errors correctly for both email and password when invalid

Open ToseebNadaf opened this issue 1 year ago • 1 comments

PR Fixes:

  • Added Zod validation for email and password.
  • Replaced useRef with useState for better state management.
  • Memoized handleEmailChange with useCallback to prevent unnecessary re-renders.
  • Implemented client-side form validation before sign-in attempt.
  • Mapped error responses to display meaningful error messages.

Resolves #1714

Checklist before requesting a review

  • [✅] I have performed a self-review of my code
  • [✅] I assure there is no similar/duplicate pull request regarding same issue

Before -->

https://github.com/user-attachments/assets/75d20992-6d3f-48bf-ad51-714ea14bcafd

After -->

https://github.com/user-attachments/assets/0d7147a9-18ef-4647-bc55-cf0258280101

ToseebNadaf avatar Jan 15 '25 21:01 ToseebNadaf

@devsargam suggest any changes if needed

ToseebNadaf avatar Jan 16 '25 13:01 ToseebNadaf