1
This commit is contained in:
@@ -141,21 +141,20 @@ namespace ZelWiki
|
||||
options.LoginPath = new PathString($"{basePath}/Identity/Account/Login");
|
||||
options.LogoutPath = new PathString($"{basePath}/Identity/Account/Logout");
|
||||
options.AccessDeniedPath = new PathString($"{basePath}/Identity/Account/AccessDenied");
|
||||
options.Cookie.Path = basePath; // Ensure the cookie is scoped to the sub-site path.
|
||||
options.Cookie.Path = basePath;
|
||||
}
|
||||
else
|
||||
{
|
||||
options.LoginPath = new PathString("/Identity/Account/Login");
|
||||
options.LogoutPath = new PathString("/Identity/Account/Logout");
|
||||
options.AccessDeniedPath = new PathString("/Identity/Account/AccessDenied");
|
||||
options.Cookie.Path = "/"; // Use root path if no base path is set.
|
||||
options.Cookie.Path = "/";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
//Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseMigrationsEndPoint();
|
||||
@@ -163,7 +162,6 @@ namespace ZelWiki
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Error");
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
@@ -175,8 +173,6 @@ namespace ZelWiki
|
||||
if (!string.IsNullOrEmpty(basePath))
|
||||
{
|
||||
app.UsePathBase(basePath);
|
||||
|
||||
// Redirect root requests to basePath (something like '/TightWiki').
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
if (context.Request.Path == "/")
|
||||
@@ -198,7 +194,7 @@ namespace ZelWiki
|
||||
|
||||
app.UseRouting();
|
||||
|
||||
app.UseAuthentication(); // Ensures the authentication middleware is configured
|
||||
app.UseAuthentication();
|
||||
app.UseAuthorization();
|
||||
|
||||
app.MapRazorPages();
|
||||
|
||||
Reference in New Issue
Block a user