diff --git a/ShopAdmin/Program.cs b/ShopAdmin/Program.cs index 34ce093..cae3ff0 100644 --- a/ShopAdmin/Program.cs +++ b/ShopAdmin/Program.cs @@ -1,6 +1,5 @@ using LiteCharms.Features.Extensions; using LiteCharms.Features.Mediator; -using Microsoft.AspNetCore.Authentication; using ShopAdmin.Components; using static LiteCharms.Features.Email.Extensions.Constants; @@ -82,6 +81,12 @@ builder.Services.AddAuthentication(options => }; }); +builder.Services.Configure(options => +{ + options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto; + options.KnownProxies.Clear(); +}); + var app = builder.Build(); var schedulerFactory = app.Services.GetRequiredService(); @@ -105,6 +110,7 @@ app.UseStatusCodePagesWithReExecute("/not-found", createScopeForStatusCodePages: app.UseHttpsRedirection(); app.UseAntiforgery(); +app.UseForwardedHeaders(); app.UseAuthentication(); app.UseAuthorization(); diff --git a/ShopAdmin/ShopAdmin.csproj b/ShopAdmin/ShopAdmin.csproj index 309dd4e..543805d 100644 --- a/ShopAdmin/ShopAdmin.csproj +++ b/ShopAdmin/ShopAdmin.csproj @@ -57,6 +57,8 @@ + +