Skip to content

Commit d66558b

Browse files
author
Matthew John Cheetham
authored
Fix bug passing username hint to credential lookup (#1280)
2 parents ae15915 + 2a79403 commit d66558b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shared/GitHub/GitHubHostProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ public async Task<ICredential> GetCredentialAsync(InputArguments input)
132132
// If we have a specific username then we can try and find an existing credential for that account.
133133
// If not, we should check what accounts are available in the store and prompt the user if there
134134
// are multiple options.
135-
string userName = null;
135+
string userName = input.UserName;
136136
bool addAccount = false;
137-
if (string.IsNullOrWhiteSpace(input.UserName))
137+
if (string.IsNullOrWhiteSpace(userName))
138138
{
139139
IList<string> accounts = _context.CredentialStore.GetAccounts(service);
140140
_context.Trace.WriteLine($"Found {accounts.Count} accounts in the store for service={service}.");
@@ -172,7 +172,7 @@ public async Task<ICredential> GetCredentialAsync(InputArguments input)
172172

173173
// No existing credential was found, create a new one
174174
_context.Trace.WriteLine("Creating new credential...");
175-
credential = await GenerateCredentialAsync(remoteUri, input.UserName);
175+
credential = await GenerateCredentialAsync(remoteUri, userName);
176176
_context.Trace.WriteLine("Credential created.");
177177
}
178178
else

0 commit comments

Comments
 (0)