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

Commit be778e4

Browse files
Merge branch 'master' into enhancements/more-metrics
2 parents 430f0ba + 467fe02 commit be778e4

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
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)

src/GitHub.Api/Git/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ public void Initialize(IGitClient client)
411411
if (needsRefresh)
412412
{
413413
needsRefresh = false;
414-
UpdateUserAndEmail();
414+
GitUserCacheOnCacheInvalidated();
415415
}
416416
}
417417

0 commit comments

Comments
 (0)