fix: resolve login page CSS styling issues
- Map /login route to static login.html file to serve embedded CSS correctly - Redirect /login to /login.html for proper static file delivery - Fix NavigationContext namespace ambiguity in App.razor (MudBlazor vs ASP.NET) - Fix StatusCodePages middleware path validation (StartsWithSegments → StartsWith) Login page now displays with: - Gradient background with frosted glass card design - Properly styled form inputs and validation - Professional Material Design appearance - Working client-side authentication flow Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
</html>
|
||||
|
||||
@code {
|
||||
private async Task OnNavigateAsync(NavigationContext context)
|
||||
private async Task OnNavigateAsync(Microsoft.AspNetCore.Components.Routing.NavigationContext context)
|
||||
{
|
||||
// /Account/* paths are Razor Pages, not Blazor components
|
||||
// Force browser navigation instead of Blazor routing
|
||||
|
||||
@@ -157,7 +157,7 @@ app.UseStaticFiles(new StaticFileOptions
|
||||
app.UseStatusCodePages(async ctx =>
|
||||
{
|
||||
var path = ctx.HttpContext.Request.Path.Value ?? "";
|
||||
if (!path.StartsWithSegments("/api", StringComparison.OrdinalIgnoreCase)
|
||||
if (!path.StartsWith("/api", StringComparison.OrdinalIgnoreCase)
|
||||
&& !path.StartsWith("/Account/", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
ctx.HttpContext.Response.Redirect("/not-found");
|
||||
@@ -194,6 +194,12 @@ app.MapGet("/", async (HttpContext ctx) =>
|
||||
await Task.CompletedTask;
|
||||
});
|
||||
|
||||
// Redirect /login to /login.html (static file)
|
||||
app.MapGet("/login", (HttpContext ctx) =>
|
||||
{
|
||||
ctx.Response.Redirect("/login.html", permanent: false);
|
||||
});
|
||||
|
||||
// Collection API Endpoints (must be before MapRazorComponents)
|
||||
app.MapCollectionEndpoints();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user