Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem on Heroku #1

Open
AmanRaj1608 opened this issue Jul 27, 2020 · 2 comments
Open

Problem on Heroku #1

AmanRaj1608 opened this issue Jul 27, 2020 · 2 comments
Labels
hacktoberfest Help Appreciated help wanted Extra attention is needed

Comments

@AmanRaj1608
Copy link
Owner

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
Copy link

Useems commented Oct 21, 2020

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
Copy link
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Help Appreciated help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants