fix: enable WASM-first auth flow for dashboard

Key changes:
- Add @rendermode InteractiveWebAssembly to Dashboard.razor
  (CLAUDE.md mandates Interactive WebAssembly as default)
- Reorder MapRazorComponents: WebAssembly first, then Server
- Simplify login.html: just redirect after 2s (no fetch verification)

Root cause of 302 redirect loop:
- Dashboard was rendering server-side (no @rendermode specified)
- Server-side rendering can't access localStorage
- CustomAuthenticationStateProvider read empty token
- Dashboard redirected to /login
- Result: 302 loop

Solution: Force client-side WASM rendering so:
1. Blazor WASM loads in browser
2. CustomAuthenticationStateProvider accesses localStorage
3. Token is read from localStorage
4. /api/auth/me validates token
5. User is authenticated
6. Dashboard displays

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 01:38:09 +09:00
parent 53ae2fcc51
commit eae0a68f06
9 changed files with 272 additions and 7 deletions
+1 -1
View File
@@ -496,8 +496,8 @@ app.MapRazorPages();
// Map Blazor Components - catches all remaining routes
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(QuantEngine.Web.Client._Imports).Assembly);
app.Run();