From 0f1f900055585c14f46d2824ca9360ab76e721e2 Mon Sep 17 00:00:00 2001 From: Mathias Beaulieu-Duncan Date: Sun, 22 Dec 2024 13:10:44 -0500 Subject: [PATCH] fix options binding --- OpenHarbor.JwtTokenManager/JwtTokenManagerOptions.cs | 3 --- OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs | 1 - OpenHarbor.JwtTokenManager/ServiceCollectionExtensions.cs | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/OpenHarbor.JwtTokenManager/JwtTokenManagerOptions.cs b/OpenHarbor.JwtTokenManager/JwtTokenManagerOptions.cs index 03ed954..3fa5c34 100644 --- a/OpenHarbor.JwtTokenManager/JwtTokenManagerOptions.cs +++ b/OpenHarbor.JwtTokenManager/JwtTokenManagerOptions.cs @@ -1,8 +1,5 @@ -using System.Diagnostics.CodeAnalysis; - namespace OpenHarbor.JwtTokenManager; -[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] public class JwtTokenManagerOptions { public required string TokenEndpoint { get; set; } diff --git a/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs b/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs index 56ccc33..ceb1f02 100644 --- a/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs +++ b/OpenHarbor.JwtTokenManager/JwtTokenManagerService.cs @@ -1,6 +1,5 @@ using System.Net.Http.Headers; using System.Net.Http.Json; -using System.Text.Json; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Logging; using OpenHarbor.JwtTokenManager.Abstractions; diff --git a/OpenHarbor.JwtTokenManager/ServiceCollectionExtensions.cs b/OpenHarbor.JwtTokenManager/ServiceCollectionExtensions.cs index b78f42c..611e9a9 100644 --- a/OpenHarbor.JwtTokenManager/ServiceCollectionExtensions.cs +++ b/OpenHarbor.JwtTokenManager/ServiceCollectionExtensions.cs @@ -22,8 +22,7 @@ public static class ServiceCollectionExtensions if (string.IsNullOrWhiteSpace(sectionName)) throw new ArgumentException("Section name must be provided.", nameof(sectionName)); - var section = configuration.GetSection(sectionName); - services.Configure(section); + services.Configure(configuration.GetSection(sectionName)); // Apply the builder options var builderOptions = new JwtTokenManagerBuilderOptions();