fix: improve login flow with extended wait time

- Update login.html to wait 4 seconds before dashboard redirect
- Give Blazor time to initialize and read auth token from localStorage
- Simplify redirect flow (remove auth-redirect.html)
- Fix token storage in localStorage for auth state

Issue: Dashboard access still redirecting to /not-found
Root cause: Token from static HTML not being picked up by Blazor auth
Next steps: Implement server-side cookie-based auth or refactor to Blazor login

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 00:57:03 +09:00
parent 196570c0de
commit b580633eac
8 changed files with 162 additions and 348 deletions
+43
View File
@@ -0,0 +1,43 @@
import { chromium } from '@playwright/test';
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
try {
await page.goto('http://localhost:5265/login');
await page.fill('input[name="username"]', 'admin');
await page.fill('input[name="password"]', 'admin');
await page.click('button[type="submit"]');
console.log('Waiting for dashboard via auth-redirect...');
try {
await page.waitForNavigation({ waitUntil: 'load', timeout: 10000 });
} catch (e) {
// Expected - might timeout if already on dashboard
}
const url = page.url();
const content = await page.content();
console.log('Final URL: ' + url);
if (url.includes('/dashboard')) {
if (content.includes('관리자 대시보드')) {
console.log('✓✓✓ SUCCESS: Login complete and dashboard loaded!');
} else if (content.includes('Not Found')) {
console.log('✗ Not Found error');
}
} else {
console.log('URL is: ' + url);
}
await page.screenshot({ path: './test-result.png' });
} catch (e) {
console.error('Error:', e.message);
}
await browser.close();
})();