Skip to content

Commit

Permalink
Improve cache, remove after used
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Jul 30, 2023
1 parent fcbf050 commit be4bf96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ await HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
AllowRefresh = false
});

// TODO clean up cache.
CacheData.RemoveFromCache(StatePresented, _distributedCache);

return Redirect($"~/Paycheck/PaycheckDetailsS3/{PaycheckId}");
}
Expand Down
10 changes: 10 additions & 0 deletions EmployeePaycheck/Services/CacheData.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Text.Json.Serialization;
using EmployeePaycheck.Services;
using Microsoft.AspNetCore.DataProtection.KeyManagement;
using Microsoft.Extensions.Caching.Distributed;

namespace VerifierInsuranceCompany.Services;
Expand Down Expand Up @@ -37,4 +38,13 @@ public static void AddToCache(string key, IDistributedCache cache, CacheData cac

return null;
}

public static void RemoveFromCache(string key, IDistributedCache cache)
{
var item = cache.GetString(key);
if (item != null)
{
cache.Remove(key);
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ https://docs.microsoft.com/azure/app-service/deploy-github-actions#configure-the
https://issueverifiableemployee.azurewebsites.net/

https://datatracker.ietf.org/doc/draft-ietf-oauth-selective-disclosure-jwt/

## Links eIDAS and EUDI standards

Draft: OAuth 2.0 Attestation-Based Client Authentication
Expand Down

0 comments on commit be4bf96

Please sign in to comment.