示例#1
0
        public IActionResult ResetPasswordOauth(ResetPasswordInput resetPasswordInput)
        {
            if (!_captcha.VerifyCaptcha(resetPasswordInput.Captcha, HttpContext.Connection.RemoteIpAddress,
                                        "resetpassword"))
            {
                _logger.LogInformation("Invalid Captcha.");
                return(BadRequest());
            }

            var user = new User
            {
                Username = resetPasswordInput.Username,
                Password = resetPasswordInput.Password
            };

            if (_authHandler.ResetPassword(ref user, resetPasswordInput.Token))
            {
                _activityLogger.LogResetPassword(Request.HttpContext.Connection.RemoteIpAddress, user);
                return(Ok());
            }

            _logger.LogInformation("Auth handler rejected account.");
            return(BadRequest());
        }
示例#2
0
 public bool ResetPassword([FromBody] dynamic model)
 {
     return(_impl.ResetPassword((string)model.authenticationCookie, (string)model.userName, (string)model.newPassword, (string)model.userData));
 }