From ce274cb9bea9b55dd90db3caa7459ca7cb7b090d Mon Sep 17 00:00:00 2001 From: Michal Muzyk Date: Wed, 6 Nov 2024 11:40:56 +0100 Subject: [PATCH] fix: tighten phone number validation --- src/libs/ValidationUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ValidationUtils.ts b/src/libs/ValidationUtils.ts index e0ab95c2c606..47e44bc049d2 100644 --- a/src/libs/ValidationUtils.ts +++ b/src/libs/ValidationUtils.ts @@ -519,7 +519,7 @@ function isValidPhoneInternational(phoneNumber: string): boolean { const phoneNumberWithCountryCode = LoginUtils.appendCountryCode(phoneNumber); const parsedPhoneNumber = parsePhoneNumber(phoneNumberWithCountryCode); - return Str.isValidE164Phone(parsedPhoneNumber.number?.e164 ?? ''); + return parsedPhoneNumber.possible && Str.isValidE164Phone(parsedPhoneNumber.number?.e164 ?? ''); } /**