diff --git a/TaskWebApp/Utils/MSALPerUserSessionTokenCache.cs b/TaskWebApp/Utils/MSALPerUserSessionTokenCache.cs
index c562031..c4dc1ce 100644
--- a/TaskWebApp/Utils/MSALPerUserSessionTokenCache.cs
+++ b/TaskWebApp/Utils/MSALPerUserSessionTokenCache.cs
@@ -178,7 +178,11 @@ private void UserTokenCacheBeforeWriteNotification(TokenCacheNotificationArgs ar
/// Contains parameters used by the MSAL call accessing the cache.
private void UserTokenCacheAfterAccessNotification(TokenCacheNotificationArgs args)
{
- this.LoadUserTokenCacheFromSession();
+ // if the access operation resulted in a cache update
+ if (args.HasStateChanged)
+ {
+ this.PersistUserTokenCache();
+ }
}
///
@@ -187,11 +191,7 @@ private void UserTokenCacheAfterAccessNotification(TokenCacheNotificationArgs ar
/// Contains parameters used by the MSAL call accessing the cache.
private void UserTokenCacheBeforeAccessNotification(TokenCacheNotificationArgs args)
{
- // if the access operation resulted in a cache update
- if (args.HasStateChanged)
- {
- this.PersistUserTokenCache();
- }
+ this.LoadUserTokenCacheFromSession();
}
///