[WIP] Adds Hsts and HttpsRedirection to templates (#128)
This commit is contained in:
parent
1a8ebaf77a
commit
509f791f10
|
|
@ -18,6 +18,7 @@ using Microsoft.AspNetCore.Identity;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
#endif
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
#if (OrganizationalAuth)
|
||||
using Microsoft.AspNetCore.Mvc.Authorization;
|
||||
#endif
|
||||
|
|
@ -121,8 +122,10 @@ namespace Company.WebApplication1
|
|||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
|
||||
#if (OrganizationalAuth || IndividualAuth)
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Identity;
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
#endif
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
#if (OrganizationalAuth && OrgReadAccess)
|
||||
|
|
@ -95,8 +96,10 @@ namespace Company.WebApplication1
|
|||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
|
||||
#if (OrganizationalAuth || IndividualAuth)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
#if (OrganizationalAuth || IndividualB2CAuth)
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
|
|
@ -49,7 +50,12 @@ namespace Company.WebApplication1
|
|||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
#if (OrganizationalAuth || IndividualAuth)
|
||||
app.UseAuthentication();
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue