Skip to content

Commit 455d32f

Browse files
Tiago Brenckjmprieur
authored andcommitted
When clearing the cache, we should pass user.GetMsalAccountId() because that is the cache key pattern that we are using. The previous code account.HomeAccountId.Identifier results in a bug for Guest accounts because Account Identifier has a different value than GetMsalAccountId(), resulting in not clearing the proper cache. (#132)
1 parent cdff32b commit 455d32f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft.Identity.Web/Client/TokenAcquisition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public async Task RemoveAccount(RedirectContext context)
282282

283283
if (account != null)
284284
{
285-
this.UserTokenCacheProvider?.Clear(account.HomeAccountId.Identifier);
285+
this.UserTokenCacheProvider?.Clear(user.GetMsalAccountId());
286286

287287
await app.RemoveAsync(account);
288288
}

0 commit comments

Comments
 (0)