diff --git a/Common/Validation/FixedValidation.cs b/Common/Validation/FixedValidation.cs index fffd221..de1eb83 100644 --- a/Common/Validation/FixedValidation.cs +++ b/Common/Validation/FixedValidation.cs @@ -38,7 +38,19 @@ namespace Common.Validation public static bool CheckUsername(this string Username) => (Username.Length == 11 && Username.StartsWith("09")) || (Username.Length == 9 && Username.StartsWith("E/")); - public static bool CheckMobile(this string Mobile) => Mobile.Length == 11 && Mobile.StartsWith("09"); + public static bool CheckMobile(this string Mobile) + { + bool pars = true; + foreach (var item in Mobile.ToCharArray()) + { + if(!Int32.TryParse(item.ToString(),out int _)) + { + pars = false; + break; + } + } + return pars && Mobile.Length == 11 && Mobile.StartsWith("09"); + } public static bool IsValidEmail(this string email) { // الگوی ساده اما معتبر برای بررسی ایمیل diff --git a/Presentation/HushianWebApp/Pages/FromUserSide/LoginComponent.razor b/Presentation/HushianWebApp/Pages/FromUserSide/LoginComponent.razor index 1ab07b7..401118e 100644 --- a/Presentation/HushianWebApp/Pages/FromUserSide/LoginComponent.razor +++ b/Presentation/HushianWebApp/Pages/FromUserSide/LoginComponent.razor @@ -1,62 +1,74 @@ -@using HushianWebApp.Service +@using Common.Validation +@using HushianWebApp.Service @inject AuthService AuthService +@inject VerificationService verificationService;