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

Commit 44ae3d8

Browse files
authored
Merge pull request #705 from github-for-unity/fixes/2fa-login-with-email
Avoiding the update of the username when we need 2fa
2 parents 9ac303a + c2a1483 commit 44ae3d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/GitHub.Api/Authentication/LoginManager.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ public async Task<LoginResultData> Login(
7272
throw new InvalidOperationException("Returned token is null or empty");
7373
}
7474

75-
username = await RetrieveUsername(loginResultData, username);
75+
if (loginResultData.Code == LoginResultCodes.Success)
76+
{
77+
username = await RetrieveUsername(loginResultData, username);
78+
}
79+
7680
keychain.SetToken(host, loginResultData.Token, username);
7781

7882
if (loginResultData.Code == LoginResultCodes.Success)

0 commit comments

Comments
 (0)