From 8450db51be8fc1e88756991d39ae4345188dbc0f Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Sun, 13 Sep 2026 17:39:29 +0200 Subject: [PATCH] Stable API run --- PostFundManagement.Api/Program.cs | 8 +------- PostFundManagement.Application/Extensions/Security.cs | 3 ++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/PostFundManagement.Api/Program.cs b/PostFundManagement.Api/Program.cs index 2eeb223..3c4bc60 100644 --- a/PostFundManagement.Api/Program.cs +++ b/PostFundManagement.Api/Program.cs @@ -91,12 +91,6 @@ builder.Services.AddOpenApi(options => }); }); -builder.Services.AddCors(options => options.AddPolicy("AllowFrontend", policy => - policy.WithOrigins("https://localhost:3000", "https://localhost:8076", "https://console.ifri.khongisa.co.za") - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials())); - var app = builder.Build(); var schedulerFactory = app.Services.GetRequiredService(); @@ -109,7 +103,7 @@ app.UseHsts(); app.UseHttpsRedirection(); app.UseRouting(); -app.UseCors("AllowFrontend"); + app.UseOutputCache(); app.UseAuthentication(); app.UseAuthorization(); diff --git a/PostFundManagement.Application/Extensions/Security.cs b/PostFundManagement.Application/Extensions/Security.cs index 4290d5f..7e2b157 100644 --- a/PostFundManagement.Application/Extensions/Security.cs +++ b/PostFundManagement.Application/Extensions/Security.cs @@ -97,6 +97,7 @@ public static class Security options.Scope.Clear(); options.Scope.Add("openid"); options.Scope.Add("profile"); + options.Scope.Add("role"); options.Scope.Add("email"); options.Events = new OpenIdConnectEvents @@ -137,7 +138,7 @@ public static class Security { options.MapInboundClaims = false; options.Authority = authOptions.Authority; - options.Audience = authOptions.Audience; + options.Audience = authOptions.Audience; options.TokenValidationParameters = new TokenValidationParameters { -- 2.47.3