Skip to content

fix : added email format and password length validation to auth route - #8

Open
tmdeveloper007 wants to merge 1 commit into
syedahmedkhaderi:mainfrom
tmdeveloper007:auth-validation
Open

fix : added email format and password length validation to auth route#8
tmdeveloper007 wants to merge 1 commit into
syedahmedkhaderi:mainfrom
tmdeveloper007:auth-validation

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Summary of What Has Been Done:
Added server-side email format validation using a regex check and enforced a minimum 8-character password length for signup. The original route accepted any non-empty email and password strings with no format or strength enforcement.

Changes Made:

  • app/api/auth/route.js: Added isValidEmail function, called it before any auth operation. Added password.length >= 8 check for signup action.

Impact it Made:

  • Prevents signup attempts with malformed email addresses
  • Prevents weak passwords being accepted at the server level
  • Verified with ESLint: no new errors introduced

Note: Please assign this PR to the tmdeveloper007 account.

- Add email format regex validation before any processing
- Require minimum 8-character password for signup
- Move captcha verification check before login flow to avoid redundant logic
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.

1 participant