Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit b1d78cd

Browse files
Fix after merge
1 parent 0cb8d78 commit b1d78cd

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/GitHub.Api/Authentication/LoginManager.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public LoginResultData Login(
9999

100100
if (loginResultData.Code == LoginResultCodes.Success)
101101
{
102-
username = RetrieveUsername(loginResultData.Token, host, username);
102+
username = RetrieveUsername(loginResultData.Token, host);
103103
keychainAdapter.Update(loginResultData.Token, username);
104104
keychain.SaveToSystem(host);
105105
}
@@ -139,7 +139,7 @@ public LoginResultData ContinueLogin(LoginResultData loginResultData, string two
139139
}
140140

141141
keychainAdapter.Update(loginResultData.Token, username);
142-
username = RetrieveUsername(loginResultData.Token, host, username);
142+
username = RetrieveUsername(loginResultData.Token, host);
143143
keychainAdapter.Update(loginResultData.Token, username);
144144
keychain.SaveToSystem(host);
145145

@@ -217,13 +217,8 @@ private LoginResultData TryLogin(
217217
return new LoginResultData(LoginResultCodes.Failed, ret.GetApiErrorMessage() ?? "Failed.", host);
218218
}
219219

220-
private string RetrieveUsername(string token, UriString host, string username = null)
220+
private string RetrieveUsername(string token, UriString host)
221221
{
222-
if (username != null && !username.Contains("@"))
223-
{
224-
return username;
225-
}
226-
227222
var command = HostAddress.IsGitHubDotCom(host) ? "validate" : "validate -h " + host.Host;
228223
var octorunTask = new OctorunTask(taskManager.Token, environment, command, token)
229224
.Configure(processManager);

0 commit comments

Comments
 (0)