// Simple manual auth validation script const puppeteer = require('puppeteer'); async function testAuth() { console.log('๐Ÿงช Testing Bulletproof Authentication System...'); const browser = await puppeteer.launch({ headless: false, defaultViewport: null, args: ['--no-sandbox', '--disable-setuid-sandbox'] }); try { const page = await browser.newPage(); // Test local deployment console.log('๐Ÿ“ Testing: http://localhost:5175'); await page.goto('http://localhost:5175', { waitUntil: 'networkidle2', timeout: 10000 }); // Check if login page loads const title = await page.title(); console.log('๐Ÿ“„ Page title:', title); const h1 = await page.$eval('h1', el => el.textContent).catch(() => 'Not found'); console.log('๐Ÿ“ H1 text:', h1); if (h1.includes('Sign in')) { console.log('โœ… Login page loaded successfully'); // Test quick login buttons const adminBtn = await page.$('button:contains("Admin")'); if (adminBtn) { console.log('โœ… Quick login buttons found'); } // Try logging in await page.type('input[type="email"]', 'admin@example.com'); await page.type('input[type="password"]', 'password123'); await page.click('[data-testid="loginBtn"]'); // Wait for redirect await page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 5000 }); const newUrl = page.url(); if (newUrl.includes('/dashboard') || newUrl.includes('/events')) { console.log('โœ… Login successful - redirected to:', newUrl); } else { console.log('โŒ Login failed - still on:', newUrl); } } else { console.log('โŒ Login page not loading correctly'); console.log('๐Ÿ“ธ Taking screenshot...'); await page.screenshot({ path: 'auth-debug.png', fullPage: true }); } } catch (error) { console.error('โŒ Test failed:', error.message); } finally { await browser.close(); } console.log('โœ… Manual auth test completed'); } testAuth();