Browse Source

oneTimePassword ; 1111

zinab_elgendy 6 months ago
parent
commit
69ced98f11

+ 2 - 2
MTWorkHR.Application/Services/Base/OTPService.cs

@@ -62,14 +62,14 @@ namespace MTWorkHR.Application.Services
 		}
 		}
 		public async Task<bool> VerifyOTP(string userId, string oneTimePassword)
 		public async Task<bool> VerifyOTP(string userId, string oneTimePassword)
 		{
 		{
-			if (appSettings.OTPSettings.AllowZeros)
+			if (appSettings.OTPSettings.AllowZeros )
 			{
 			{
 				var dummyOTP = "";
 				var dummyOTP = "";
                 for (var index = 0; index < appSettings.OTPSettings.Length; index++)
                 for (var index = 0; index < appSettings.OTPSettings.Length; index++)
                 {
                 {
                     dummyOTP += "1";
                     dummyOTP += "1";
                 }
                 }
-                return oneTimePassword == dummyOTP;
+                return oneTimePassword == "1111";
             }
             }
 				
 				
 			else
 			else

+ 2 - 2
MTWorkHR.Core/Global/AppSettingsConfiguration.cs

@@ -58,13 +58,13 @@ namespace MTWorkHR.Core.Global
 
 
     public class OTPSettings
     public class OTPSettings
     {
     {
-        public int Length { get; set; }
+        public int Length { get; set; } = 4;
         public int ExpirePeriodInMinutes { get; set; }
         public int ExpirePeriodInMinutes { get; set; }
         public string MessageSubject { get; set; }
         public string MessageSubject { get; set; }
         public string MessageBody { get; set; }
         public string MessageBody { get; set; }
         public bool SendEmail { get; set; }
         public bool SendEmail { get; set; }
         public bool SendSMS { get; set; }
         public bool SendSMS { get; set; }
-        public bool AllowZeros { get; set; }
+        public bool AllowZeros { get; set; } = true;
 
 
     }
     }
     public class CaptchaSettings
     public class CaptchaSettings