private async Task <GitHubAuthenticationSettings> GetGitHubAuthenticationSettingsAsync() { var settings = await _githubAuthenticationService.GetSettingsAsync(); if ((_githubAuthenticationService.ValidateSettings(settings)).Any(result => result != ValidationResult.Success)) { _logger.LogWarning("The Microsoft Account Authentication is not correctly configured."); return(null); } return(settings); }
public async Task ExecuteAsync(RecipeExecutionContext context) { if (!string.Equals(context.Name, nameof(GitHubAuthenticationSettings), StringComparison.OrdinalIgnoreCase)) { return; } var model = context.Step.ToObject <GitHubLoginSettingsStepModel>(); var settings = await _githubAuthenticationService.GetSettingsAsync(); settings.ClientID = model.ConsumerKey; settings.ClientSecret = model.ConsumerSecret; settings.CallbackPath = model.CallbackPath; await _githubAuthenticationService.UpdateSettingsAsync(settings); }
private async Task <GitHubAuthenticationSettings> GetGitHubAuthenticationSettingsAsync() { var settings = await _githubAuthenticationService.GetSettingsAsync(); if ((_githubAuthenticationService.ValidateSettings(settings)).Any(result => result != ValidationResult.Success)) { if (_shellSettings.State == TenantState.Running) { _logger.LogWarning("GitHub Authentication is not correctly configured."); } return(null); } return(settings); }