WIP reg page

This commit is contained in:
2022-09-23 20:34:51 +01:00
parent 14206ac477
commit fececb327e
36 changed files with 264 additions and 211 deletions

View File

@ -1,11 +1,8 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.Extensions.Hosting;
using isnd.Data;
using isnd.Interfaces;
using isnd.Services;
@ -17,8 +14,8 @@ using Unleash;
using Microsoft.Extensions.Options;
using isnd.Helpers;
using Microsoft.IdentityModel.Tokens;
using Microsoft.AspNetCore.HttpOverrides;
using System.Net;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace isnd
{
@ -86,7 +83,7 @@ namespace isnd
throw new System.Exception("No unleash client ApiUrl");
if (config.Value.ClientApiKey==null)
throw new System.Exception("No unleash client ClientApiKey");
return s.GetRequiredService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>().CreateUnleahClient(config.Value);
return s.GetRequiredService<IHostingEnvironment>().CreateUnleahClient(config.Value);
});
services.AddAuthentication("Bearer")
@ -106,25 +103,27 @@ namespace isnd
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app,
Microsoft.AspNetCore.Hosting.IHostingEnvironment env,
IHostingEnvironment env,
ApplicationDbContext dbContext)
{
app.UseForwardedHeaders();
// Not using Apache cert :
// app.UseHttpsRedirection();
// app.UseForwardedHeaders();
// app.UseDeveloperExceptionPage();
// app.UseHttpsRedirection();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseMigrationsEndPoint();
app.UseBrowserLink();
}
else
{
app.UseExceptionHandler("/Home/Error");
dbContext.Database.Migrate();
}
app
_ = app
.UseStaticFiles()
.UseAuthentication()
.UseMvc(routes =>