refactor(wbs-ux): route root authenticated users to Vue templates and map SPA fallback
This commit is contained in:
@@ -192,11 +192,11 @@ try
|
||||
Log.Warning("Hangfire setup failed: {Message}", ex.Message);
|
||||
}
|
||||
|
||||
// Root redirect: unauthenticated → /Account/Login, authenticated → /Admin/Dashboard
|
||||
// Root redirect: unauthenticated → /Account/Login, authenticated → Vue 3 SPA /templates
|
||||
app.MapGet("/", context =>
|
||||
{
|
||||
if (context.User?.Identity?.IsAuthenticated ?? false)
|
||||
context.Response.Redirect("/Admin/Dashboard");
|
||||
context.Response.Redirect("/templates");
|
||||
else
|
||||
context.Response.Redirect("/Account/Login");
|
||||
return Task.CompletedTask;
|
||||
@@ -210,6 +210,8 @@ try
|
||||
});
|
||||
|
||||
app.MapRazorPages();
|
||||
app.MapFallbackToFile("index.html");
|
||||
|
||||
|
||||
app.Run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user