From a323da829f00bf4ff116bf0c0f852327d6136607 Mon Sep 17 00:00:00 2001 From: Leon Hoppe Date: Mon, 23 Dec 2024 14:22:02 +0100 Subject: [PATCH] Removed default memory cache provider --- .../Authentication/HopFrameAuthenticationExtensions.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/HopFrame.Security/Authentication/HopFrameAuthenticationExtensions.cs b/src/HopFrame.Security/Authentication/HopFrameAuthenticationExtensions.cs index 228804e..f6a52e8 100644 --- a/src/HopFrame.Security/Authentication/HopFrameAuthenticationExtensions.cs +++ b/src/HopFrame.Security/Authentication/HopFrameAuthenticationExtensions.cs @@ -28,9 +28,11 @@ public static class HopFrameAuthenticationExtensions { service.AddScoped(typeof(ICacheProvider), config.CacheProvider); service.TryAddSingleton(); service.AddScoped(); + + if (config.CacheProvider == typeof(MemoryCacheProvider)) + service.AddMemoryCache(); - service.AddHttpClient(); - service.AddMemoryCache(); + service.AddHttpClient(); service.AddScoped(); service.AddOptionsFromConfiguration(configuration);