Skip to content

Commit

Permalink
Merge pull request #57 from Azure-Samples/tibre/cacheMethodSwapped
Browse files Browse the repository at this point in the history
Fixed swapped cache methods
  • Loading branch information
jmprieur authored May 30, 2019
2 parents 7f39714 + 79f604f commit bf3bcce
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions TaskWebApp/Utils/MSALPerUserSessionTokenCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ private void UserTokenCacheBeforeWriteNotification(TokenCacheNotificationArgs ar
/// <param name="args">Contains parameters used by the MSAL call accessing the cache.</param>
private void UserTokenCacheAfterAccessNotification(TokenCacheNotificationArgs args)
{
this.LoadUserTokenCacheFromSession();
// if the access operation resulted in a cache update
if (args.HasStateChanged)
{
this.PersistUserTokenCache();
}
}

/// <summary>
Expand All @@ -187,11 +191,7 @@ private void UserTokenCacheAfterAccessNotification(TokenCacheNotificationArgs ar
/// <param name="args">Contains parameters used by the MSAL call accessing the cache.</param>
private void UserTokenCacheBeforeAccessNotification(TokenCacheNotificationArgs args)
{
// if the access operation resulted in a cache update
if (args.HasStateChanged)
{
this.PersistUserTokenCache();
}
this.LoadUserTokenCacheFromSession();
}

/// <summary>
Expand Down

0 comments on commit bf3bcce

Please sign in to comment.