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()); }
public bool ResetPassword([FromBody] dynamic model) { return(_impl.ResetPassword((string)model.authenticationCookie, (string)model.userName, (string)model.newPassword, (string)model.userData)); }