Пример #1
0
        public async Task <IActionResult> ForgotPassword([FromBody] ForgotPasswordModel model)
        {
            #region Validate Model

            //var userInputValidated = _forgotPasswordValidator.Validate(model);

            //if (!userInputValidated.IsValid)
            //    return BadRequest(new {
            //        Succeeded = false,
            //        Message = _badRequest.ShowError(int.Parse(userInputValidated.Errors[0].ErrorMessage))
            //    });

            #endregion

            var sentResetPassword = await _user.ForgotPassword(model);

            return(Ok(sentResetPassword));
        }
Пример #2
0
        public async Task <IActionResult> ForgotPassword([FromBody] ForgotPasswordModel model)
        {
            #region Validate Model

            var userInputValidated = _forgotPasswordValidator.Validate(model);

            if (!userInputValidated.IsValid)
            {
                _infos.Add(_badRequest.ShowError(int.Parse(userInputValidated.Errors[0].ErrorMessage)).Message);

                return(BadRequest(new CustomResponse <string> {
                    Message = _infos
                }));
            }

            #endregion

            var sentResetPassword = await _user.ForgotPassword(model);

            return(Ok(sentResetPassword));
        }