Unify picture configuration and options registration

This commit is contained in:
2026-09-24 05:23:40 +02:00
parent 5e819d7676
commit 4d943e068e
51 changed files with 384 additions and 525 deletions
@@ -1,5 +1,5 @@
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.Extensions.Options;
using Musify.Application.Configuration;
namespace Musify.Api.Authentication;
@@ -9,13 +9,7 @@ public static class AuthenticationExtensions
this IServiceCollection services,
IConfiguration configuration)
{
services
.AddOptionsWithValidateOnStart<AuthenticationConfiguration>()
.Bind(configuration.GetRequiredSection(AuthenticationConfiguration.SectionName))
.ValidateDataAnnotations();
services.AddSingleton(serviceProvider =>
serviceProvider.GetRequiredService<IOptions<AuthenticationConfiguration>>().Value);
services.AddValidatedOptions<AuthenticationConfiguration>(configuration);
services.AddMemoryCache();
services.AddHttpClient();