Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit fe41eb0

Browse files
authored
Merge pull request #840 from jeschu1/AlwaysDelete
Always delete
2 parents 24ce48f + bdd86ef commit fe41eb0

File tree

3 files changed

+16
-24
lines changed

3 files changed

+16
-24
lines changed

AzureDevOps.Authentication/Src/Authentication.cs

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,31 +131,23 @@ public override async Task<bool> DeleteCredentials(TargetUri targetUri)
131131
if (targetUri is null)
132132
throw new ArgumentNullException(nameof(targetUri));
133133

134-
Credential credentials = await PersonalAccessTokenStore.ReadCredentials(targetUri);
134+
await PersonalAccessTokenStore.DeleteCredentials(targetUri);
135135

136-
// Attempt to validate the credentials, if they're truly invalid delete them.
137-
if (!await ValidateCredentials(targetUri, credentials))
138-
{
139-
await PersonalAccessTokenStore.DeleteCredentials(targetUri);
140-
141-
// Remove any related entries from the tenant cache because tenant change
142-
// could the be source of the invalidation, and not purging the cache will
143-
// trap the user in a limbo state of invalid credentials.
144-
145-
// Deserialize the cache and remove any matching entry.
146-
string tenantUrl = targetUri.ToString();
147-
var cache = await DeserializeTenantCache(Context);
136+
// Remove any related entries from the tenant cache because tenant change
137+
// could the be source of the invalidation, and not purging the cache will
138+
// trap the user in a limbo state of invalid credentials.
148139

149-
// Attempt to remove the URL entry, if successful serialize the cache.
150-
if (cache.Remove(tenantUrl))
151-
{
152-
await SerializeTenantCache(Context, cache);
153-
}
140+
// Deserialize the cache and remove any matching entry.
141+
string tenantUrl = GetTargetUrl(targetUri, keepUsername: false);
142+
var cache = await DeserializeTenantCache(Context);
154143

155-
return true;
144+
// Attempt to remove the URL entry, if successful serialize the cache.
145+
if (cache.Remove(tenantUrl))
146+
{
147+
await SerializeTenantCache(Context, cache);
156148
}
157149

158-
return false;
150+
return true;
159151
}
160152

161153
/// <summary>

Cli/Askpass/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
[assembly: AssemblyTrademark("Microsoft Corporation")]
1313
[assembly: AssemblyCulture("")]
1414
[assembly: Guid("19770407-63d4-1230-a9df-f1c4b473308a")]
15-
[assembly: AssemblyVersion("1.18.4.0")]
16-
[assembly: AssemblyFileVersion("1.18.4.0")]
15+
[assembly: AssemblyVersion("1.18.5.0")]
16+
[assembly: AssemblyFileVersion("1.18.5.0")]
1717
[assembly: NeutralResourcesLanguage("en-US")]
1818

1919
// Only expose internals when the binary isn't signed.

Cli/Manager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
[assembly: AssemblyTrademark("Microsoft Corporation")]
1313
[assembly: AssemblyCulture("")]
1414
[assembly: Guid("19770407-63d4-0415-a9df-f1c4b473308a")]
15-
[assembly: AssemblyVersion("1.18.4.0")]
16-
[assembly: AssemblyFileVersion("1.18.4.0")]
15+
[assembly: AssemblyVersion("1.18.5.0")]
16+
[assembly: AssemblyFileVersion("1.18.5.0")]
1717
[assembly: NeutralResourcesLanguage("en-US")]
1818

1919
// Only expose internals when the binary isn't signed.

0 commit comments

Comments
 (0)