Skip to content

fix: align phone number validation across registration and profile update - #1016

Open
tylrx404 wants to merge 1 commit into
Shivayan09:mainfrom
tylrx404:fix/phone-validation-consistency
Open

fix: align phone number validation across registration and profile update#1016
tylrx404 wants to merge 1 commit into
Shivayan09:mainfrom
tylrx404:fix/phone-validation-consistency

Conversation

@tylrx404

@tylrx404 tylrx404 commented Jul 24, 2026

Copy link
Copy Markdown

Related Issue

Closes #964

📌 Summary

This PR resolves the inconsistent phone number validation between the registration and profile update flows.

✅ Changes Made

  • Removed the redundant 10-digit validation from auth.controller.js since registerSchema already validates phone numbers using validator.isMobilePhone(..., "any").
  • Updated the registration phone input to allow international phone number formats (+, spaces, and hyphens).
  • Updated profile phone validation to accept international phone numbers instead of enforcing a strict 10-digit format.

🎯 Result

Registration and profile update now follow consistent validation behavior and support both local and international phone numbers.

🧪 Testing

  • ✅ Registered a user using an international phone number.
  • ✅ Verified profile update accepts international phone numbers.
  • ✅ Confirmed local phone numbers continue to work.
  • ✅ Ran git diff --check successfully.

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

@tylrx404 is attempting to deploy a commit to the Shivayan'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.

Fix inconsistent phone number validation between registration and profile update

1 participant