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

Commit febaa6c

Browse files
authored
Merge branch 'master' into fixes/user-cache-update
2 parents 532bfe0 + 44ae3d8 commit febaa6c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/GitHub.Api/Authentication/Keychain.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ public async Task Clear(UriString host, bool deleteFromCredentialManager)
152152

153153
Guard.ArgumentNotNull(host, nameof(host));
154154

155+
RemoveConnection(host);
156+
155157
//clear octokit credentials
156158
await RemoveCredential(host, deleteFromCredentialManager);
157-
RemoveConnection(host);
158159
}
159160

160161
public async Task Save(UriString host)

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)