PWA - patched deps

This commit is contained in:
Giancarmine Salucci
2025-11-29 17:35:20 +01:00
parent dfa2eb1c4e
commit 0477964009
11 changed files with 10435 additions and 4656 deletions

25
scripts/gen-auth.js Normal file
View File

@@ -0,0 +1,25 @@
import { chromium } from 'playwright';
import fs from 'fs';
import path from 'path';
(async () => {
const browser = await chromium.launch({ headless: false });
const context = await browser.newContext();
const page = await context.newPage();
console.log('🔹 Navigating to Instagram...');
await page.goto('https://www.instagram.com/');
console.log('⏳ Please log in manually. Waiting for "Home" icon...');
try {
await page.waitForSelector('svg[aria-label="Home"]', { timeout: 120000 });
const secretsDir = path.resolve('secrets');
if (!fs.existsSync(secretsDir)) fs.mkdirSync(secretsDir);
await context.storageState({ path: path.join(secretsDir, 'auth.json') });
console.log('🎉 Session saved to secrets/auth.json');
} catch (e) {
console.error('❌ Timeout or error:', e);
}
await browser.close();
})();