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

Commit 94c4344

Browse files
Always get the username from the Api because we have no idea what the user gave us
Co-authored-by: iamwillshepherd <iamwillshepherd@users.noreply.github.com>
1 parent 5ae520f commit 94c4344

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
@@ -73,7 +73,7 @@ public LoginResultData Login(
7373

7474
if (loginResultData.Code == LoginResultCodes.Success)
7575
{
76-
username = RetrieveUsername(loginResultData, username);
76+
username = RetrieveUsername();
7777
keychainAdapter.Update(loginResultData.Token, username);
7878
keychain.SaveToSystem(host);
7979
}
@@ -113,7 +113,7 @@ public LoginResultData ContinueLogin(LoginResultData loginResultData, string two
113113
}
114114

115115
keychainAdapter.Update(loginResultData.Token, username);
116-
username = RetrieveUsername(loginResultData, username);
116+
username = RetrieveUsername();
117117
keychainAdapter.Update(loginResultData.Token, username);
118118
keychain.SaveToSystem(host);
119119

@@ -180,13 +180,8 @@ private LoginResultData TryLogin(
180180
return new LoginResultData(LoginResultCodes.Failed, ret.GetApiErrorMessage() ?? "Failed.", host);
181181
}
182182

183-
private string RetrieveUsername(LoginResultData loginResultData, string username)
183+
private string RetrieveUsername()
184184
{
185-
if (!username.Contains("@"))
186-
{
187-
return username;
188-
}
189-
190185
var octorunTask = new OctorunTask(taskManager.Token, keychain, environment, "validate")
191186
.Configure(processManager);
192187

0 commit comments

Comments
 (0)