AmanRaj1608 / Google-Meet-Scheduler

šŸ˜“ Attends classes for you.
https://meet-scheduler.glitch.me/
193 stars 38 forks source link

Problem on Heroku #1

Open AmanRaj1608 opened 4 years ago

AmanRaj1608 commented 4 years ago

There was some problem on Heroku.

I added and deployed then to a screenshot of whats the actual problem. I took a snapshot of what is happening on Heroku.

app.get('/screenshot', async (req, res) => {
    try {
        // Open browser
        let browser = await puppeteer.launch({
            headless: true,
            args: [
                '--no-sandbox',
                '--disable-setuid-sandbox',
                '--disable-dev-shm-usage',
                '--single-process',
                '--use-fake-ui-for-media-stream',
                '--disable-audio-output'
            ],
        });
        console.log("opening login page");
        let page = await browser.newPage()
        await page.goto('https://accounts.google.com/signin/v2/identifier?flowName=GlifWebSignIn&flowEntry=ServiceLogin')
        console.log('logging in');
        // Login Start
        await page.type("input#identifierId", email, {
            delay: 0
        })
        await page.click("div#identifierNext")
        await page.waitFor(7000)
        console.log('entering password')
        await page.type("input.whsOnd.zHQkBf", password, {
            delay: 0
        })
        await page.click("div#passwordNext")
        await page.waitFor(5000)
        // await page.goto(url)
        await page.screenshot().then(function (buffer) {
            res.setHeader('Content-Disposition', 'attachment;filename="' + url + '.png"');
            res.setHeader('Content-Type', 'image/png');
            console.log(buffer);
            res.send(buffer);
        });
        // await browser.close();
    } catch (err) {
        res.send('Err ')
        console.log(err)
    }
});

main_problem_on_heroku

As its a new IP we need to again set one time OTP. So we need to add a function init to run and it for deployment on Heroku.

Useems commented 4 years ago

One way to bypass this is turning off the 2-Step Verification of your account. I know that it's more insecure, but it's an alternative. I did it when I had problems with nodemailer and I solved them. If you prioritize security, ignore this. You can check here how to do the proccess.

AmanRaj1608 commented 3 years ago

No @Useems, this is not a 2-Step verification issue.

What happens is when you try to login from a different location/IP google wants sends an OTP for that machine. You cant try signing in on the cloud it will prompt this issue.