53ae2fcc51
Root cause: [Authorize] attribute was blocking /dashboard access before Blazor auth state could be established, causing redirect to /not-found. Solution: - Remove [Authorize] from Dashboard.razor - Add authentication check in OnInitializedAsync - If not authenticated, redirect to login internally - Reduced wait time from 6s to 3s in login.html This allows: 1. /dashboard to load immediately 2. Blazor auth state to initialize 3. Dashboard to verify user is authenticated 4. Redirect to login if not authenticated Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import { chromium } from "@playwright/test";
|
|
|
|
(async () => {
|
|
console.log("=== SIMPLE DIRECT TEST ===\n");
|
|
|
|
const b = await chromium.launch({ headless: false });
|
|
const p = await b.newPage();
|
|
|
|
// 모든 콘솔 로그 출력
|
|
p.on("console", msg => console.log(` [${msg.type()}] ${msg.text()}`));
|
|
|
|
try {
|
|
console.log("1. Navigate to login...");
|
|
// URL에 타임스탐프 추가 (캐시 무시)
|
|
await p.goto("http://localhost:5265/login.html?v=" + Date.now());
|
|
|
|
console.log("2. Submit form...");
|
|
await p.fill("input[name='username']", "admin");
|
|
await p.fill("input[name='password']", "admin");
|
|
|
|
// Before submit - 현재 URL
|
|
console.log(" URL before submit: " + p.url());
|
|
|
|
await p.click("button[type='submit']");
|
|
|
|
// 8초 동안 URL 변화 감시
|
|
console.log("3. Monitoring for 8 seconds...");
|
|
let lastUrl = "";
|
|
for (let i = 0; i < 8; i++) {
|
|
await new Promise(r => setTimeout(r, 1000));
|
|
const currentUrl = p.url();
|
|
if (currentUrl !== lastUrl) {
|
|
console.log(` [${i+1}s] ➜ ${currentUrl}`);
|
|
lastUrl = currentUrl;
|
|
}
|
|
}
|
|
|
|
console.log("\n4. RESULT: " + p.url());
|
|
|
|
} catch (e) {
|
|
console.error("Error:", e.message);
|
|
}
|
|
|
|
await b.close();
|
|
})();
|