Corrige la suppression de paquets

This commit is contained in:
2022-06-19 21:40:31 +01:00
parent 97eba2390e
commit a84e1d9750
11 changed files with 66 additions and 73 deletions

View File

@ -17,6 +17,8 @@ using Unleash;
using Microsoft.Extensions.Options;
using isnd.Helpers;
using Microsoft.IdentityModel.Tokens;
using Microsoft.AspNetCore.HttpOverrides;
using System.Net;
namespace isnd
{
@ -25,7 +27,6 @@ namespace isnd
public Startup(IConfiguration config)
{
Configuration = config;
}
public IConfiguration Configuration { get; }
@ -52,7 +53,13 @@ namespace isnd
.AddSignInManager()
.AddDefaultUI()
.AddDefaultTokenProviders();
/*
services.Configure<ForwardedHeadersOptions>(options =>
{
options.ForwardedHeaders =
ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
});
*/
services.AddMvc();
services.AddDataProtection();
@ -85,14 +92,11 @@ namespace isnd
services.AddAuthentication("Bearer")
.AddJwtBearer("Bearer", options =>
{
options.Authority = "https://localhost:5001";
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateAudience = false
};
});
}
@ -105,6 +109,9 @@ namespace isnd
Microsoft.AspNetCore.Hosting.IHostingEnvironment env,
ApplicationDbContext dbContext)
{
// app.UseForwardedHeaders();
// .UseHttpsRedirection();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@ -113,12 +120,12 @@ namespace isnd
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
dbContext.Database.Migrate();
}
app.UseHttpsRedirection();
app.UseStatusCodePages().UseStaticFiles().UseAuthentication().UseMvc(routes =>
app
.UseStaticFiles()
.UseAuthentication()
.UseMvc(routes =>
{
routes.MapRoute(
name: "default",