Files
QuantEngineByItz/final-integrated.mjs
T
kjh2064 bcd1cc0f93
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 7s
Quant Engine CI/CD Pipeline / validate-core (push) Failing after 15s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (push) Has been skipped
Deploy to Production / Build & Deploy to Production (push) Failing after 3m14s
refactor: switch to cookie-based auth flow with JS interop fallback
Architecture shift:
- Primary: HTTP-only cookie authentication (server-side)
- Fallback: localStorage with JS interop for SPA

Changes:
1. CustomAuthenticationStateProvider:
   - Add IJSRuntime for direct localStorage access
   - Try JS interop first, fallback to LocalStorageService
   - Added detailed logging for auth debugging

2. Dashboard.razor:
   - Add @rendermode InteractiveWebAssembly (CLAUDE.md compliance)
   - Restore auth check with logging
   - Redirect to /login.html if not authenticated

3. Program.cs:
   - Reorder MapRazorComponents: WebAssembly first (default)
   - Add detailed logging to /api/auth/login cookie setup
   - Verify Set-Cookie headers are sent correctly

4. login.html:
   - Simplified to 2-second wait before redirect
   - localStorage as backup storage
   - Ready for cookie-based auth

Next steps:
- Verify Set-Cookie headers appear in responses
- Confirm cookie-based auth works end-to-end
- Test dashboard loads with cookie authentication

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-06 01:48:01 +09:00

71 lines
2.6 KiB
JavaScript

import { chromium } from "@playwright/test";
(async () => {
console.log("════════════════════════════════════════════════════════");
console.log(" ✅ FINAL INTEGRATED TEST (JS Interop Enabled)");
console.log("════════════════════════════════════════════════════════\n");
const b = await chromium.launch({ headless: false });
const p = await b.newPage();
p.on("console", msg => {
const text = msg.text();
if (text.includes("[Auth]") || text.includes("[Dashboard]") || text.includes("[Login]")) {
console.log(" 📝 " + text);
}
});
try {
console.log("1️⃣ 로그인 페이지 로드");
await p.goto("http://localhost:5265/login.html", { waitUntil: "networkidle" });
console.log("2️⃣ 로그인 (admin/admin)");
await p.fill("input[name='username']", "admin");
await p.fill("input[name='password']", "admin");
await p.click("button[type='submit']");
console.log("3️⃣ 대기 및 모니터링 (12초)\n");
for (let i = 1; i <= 12; i++) {
await new Promise(r => setTimeout(r, 1000));
const url = p.url();
if (!url.includes("login")) {
console.log(`\n ✅ [${i}s] 리다이렉트됨!`);
console.log(` URL: ${url}`);
break;
}
}
const finalUrl = p.url();
console.log(`\n4️⃣ 최종 상태:`);
console.log(` URL: ${finalUrl}`);
if (finalUrl.includes("/dashboard")) {
console.log(" ✅ 대시보드 도착!");
// 콘텐츠 확인
await new Promise(r => setTimeout(r, 2000));
const content = await p.content();
if (content.includes("관리자 대시보드")) {
console.log(" ✅ 대시보드 콘텐츠 확인됨!");
console.log("\n🎉🎉🎉 로그인 시스템 완전 성공!\n");
} else {
console.log(" ⚠️ 콘텐츠 미확인");
}
} else if (finalUrl.includes("/login")) {
console.log(" ❌ 다시 로그인으로 돌아옴");
console.log(" → 인증 체크에서 실패했거나, JS interop이 작동하지 않음");
} else {
console.log(" ❓ 예상치 못한 페이지");
}
await p.screenshot({ path: "./final-integrated-test.png", fullPage: true });
console.log("📷 스크린샷: final-integrated-test.png");
} catch (e) {
console.error("Error:", e.message);
}
await b.close();
})();