feat: implement Razor Pages and static HTML login pages

Added two implementations of login page:
1. Razor Pages (Pages/Login.cshtml + Login.cshtml.cs)
   - Server-side rendering with form submission
   - Username remembering with cookies
   - Error handling and validation

2. Static HTML (wwwroot/login.html)
   - Pure HTML/CSS/JavaScript
   - Client-side form submission
   - LocalStorage for username persistence
   - Direct API call to /api/auth/login

Both implementations:
 Professional styling (dark theme, blur effects, primary blue buttons)
 Form validation
 Error message display
 ID persistence (LocalStorage/Cookies)
 Responsive design (mobile support)
 Integration with /api/auth/login endpoint

Technical notes:
- Blazor routing (@rendermode InteractiveServer) has limitations in .NET 10 Blazor Web App
- Razor Pages and static files are bypassed by Blazor's catch-all routing
- For production: recommend deploying login.html separately via nginx/reverse proxy
- Or use URL pattern like /user/login (outside Blazor's @page definitions)

Current workaround:
- Manually access: http://localhost:5265/login.html (works)
- API endpoint /api/auth/login is fully functional
- Ready for frontend deployment separation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 23:50:44 +09:00
parent 1cec63366c
commit 48cb917df2
14 changed files with 875 additions and 286 deletions
+7
View File
@@ -35,6 +35,7 @@ var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog();
// Add services to the container.
builder.Services.AddRazorPages();
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();
@@ -414,6 +415,12 @@ app.MapPost("/api/history/{domain}", async (string domain, JsonElement payload,
});
});
// Razor Pages (로그인 등)
app.MapRazorPages();
// 정적 로그인 페이지 (wwwroot/login.html)
app.MapGet("/login", () => Results.File("wwwroot/login.html", "text/html"));
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()