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

Commit 979bc4e

Browse files
Keeping the user if the username doesn't match the keychain
1 parent acc6efc commit 979bc4e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/GitHub.Api/Authentication/Keychain.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,15 @@ public async Task<IKeychainAdapter> Load(UriString host)
6464
logger.Warning("Cannot load host from Credential Manager; removing from cache");
6565
await Clear(host, false);
6666
}
67-
else if (keychainItem.Username != cachedConnection.Username)
68-
{
69-
logger.Warning("Item loaded from credential manager does not match connection cache ; removing from cache");
70-
await Clear(host, false);
71-
}
7267
else
7368
{
74-
logger.Trace($@"Loaded from Credential Manager Host:""{keychainItem.Host}"" Username:""{keychainItem.Username}""");
69+
if (keychainItem.Username != cachedConnection.Username)
70+
{
71+
logger.Warning("Keychain Username: {0} does not match; Hopefully it works", keychainItem.Username);
72+
}
73+
74+
logger.Trace("Loaded from Credential Manager Host:\"{0}\" Username:\"{1}\"", keychainItem.Host, keychainItem.Username);
75+
7576
keychainAdapter.Set(keychainItem);
7677
}
7778

0 commit comments

Comments
 (0)