Skip to content

Commit

Permalink
Fix bug passing username hint to credential lookup (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcheetham committed Jun 1, 2023
2 parents ae15915 + 2a79403 commit d66558b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shared/GitHub/GitHubHostProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ public async Task<ICredential> GetCredentialAsync(InputArguments input)
// If we have a specific username then we can try and find an existing credential for that account.
// If not, we should check what accounts are available in the store and prompt the user if there
// are multiple options.
string userName = null;
string userName = input.UserName;
bool addAccount = false;
if (string.IsNullOrWhiteSpace(input.UserName))
if (string.IsNullOrWhiteSpace(userName))
{
IList<string> accounts = _context.CredentialStore.GetAccounts(service);
_context.Trace.WriteLine($"Found {accounts.Count} accounts in the store for service={service}.");
Expand Down Expand Up @@ -172,7 +172,7 @@ public async Task<ICredential> GetCredentialAsync(InputArguments input)

// No existing credential was found, create a new one
_context.Trace.WriteLine("Creating new credential...");
credential = await GenerateCredentialAsync(remoteUri, input.UserName);
credential = await GenerateCredentialAsync(remoteUri, userName);
_context.Trace.WriteLine("Credential created.");
}
else
Expand Down

0 comments on commit d66558b

Please sign in to comment.