Compare commits
3 Commits
v1.1.0
...
2e9a3108f4
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e9a3108f4 | |||
| 9c58bc2948 | |||
| edfc18d7f4 |
@@ -46,9 +46,9 @@ public abstract class AppDbContext : DbContext
|
||||
foreach(var entry in entries) {
|
||||
if (entry.State == EntityState.Added)
|
||||
{
|
||||
((BaseEntity)entry.Entity).DateCreated = DateTime.Now;
|
||||
((BaseEntity)entry.Entity).DateCreated = DateTime.UtcNow;
|
||||
}
|
||||
((BaseEntity)entry.Entity).DateModified = DateTime.Now;
|
||||
((BaseEntity)entry.Entity).DateModified = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ namespace WebNovelPortal.Controllers
|
||||
{
|
||||
await HttpContext.ChallengeAsync(new AuthenticationProperties
|
||||
{
|
||||
RedirectUri = redirect
|
||||
RedirectUri = redirect,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.HttpOverrides;
|
||||
using Newtonsoft.Json;
|
||||
using Treestar.Shared.AccessLayers;
|
||||
using Treestar.Shared.Authentication.OIDC;
|
||||
@@ -19,9 +20,14 @@ builder.Services.AddControllers().AddNewtonsoftJson(opt =>
|
||||
opt.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
|
||||
});
|
||||
builder.Services.AddOIDCAuth(builder.Configuration);
|
||||
builder.Services.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders =
|
||||
ForwardedHeaders.XForwardedHost | ForwardedHeaders.XForwardedProto;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseForwardedHeaders();
|
||||
// Configure the HTTP request pipeline.
|
||||
if (!app.Environment.IsDevelopment())
|
||||
{
|
||||
@@ -29,8 +35,12 @@ if (!app.Environment.IsDevelopment())
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
//app.UseHttpsRedirection();
|
||||
|
||||
app.UseStaticFiles();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user