Example #1
0
 public ActionResult ValidatePassword([FromBody] PasswordValidationModel passwordValidationModel)
 {
     try
     {
         if (string.IsNullOrEmpty(passwordValidationModel.Password))
         {
             return(BadRequest());
         }
         return(Ok(_passwordValidatorService.ValidatePassword(passwordValidationModel.Password, passwordValidationModel.UserId)));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, "An error occurred"));
     }
 }
Example #2
0
        public async Task <IActionResult> ValidatePassword([FromQuery] PasswordValidationModel model)
        {
            IEmployeeCredentials employeeCredentials =
                await _employeeCredentialsService.ValidatePasswordAsync(model.Email, model.Password);

            if (employeeCredentials == null)
            {
                return(Ok(new CredentialsValidationResultModel(false)));
            }

            return(Ok(new CredentialsValidationResultModel(true)
            {
                MerchantId = employeeCredentials.MerchantId,
                EmployeeId = employeeCredentials.EmployeeId,
                ForcePasswordUpdate = employeeCredentials.ForcePasswordUpdate,
                ForcePinUpdate = employeeCredentials.ForcePinUpdate,
                ForceEmailConfirmation = employeeCredentials.ForceEmailConfirmation
            }));
        }