question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request timed out error while using Google provider

See original GitHub issue

Description 🐜

After following the docs for Prisma Adapter and Google Provider, I added auth to my repo, but when trying to log in through google auth, it’s timing out for some reason.

image

I even tried with a longer timeout, but still no luck 😦

providers: [
    GoogleProvider({
      clientId: process.env.GOOGLE_CLIENT_ID,
      clientSecret: process.env.GOOGLE_CLIENT_SECRET,
      httpOptions: {
        timeout: 10000,
      }
    })
  ],

image

Is this a bug in your own project?

Yes

How to reproduce ☕️

I replicated the issue in a new separate repo, just add the env variable and run it in local - https://github.com/Nikit-Singh/next-auth-google-issue

Screenshots / Logs 📽

No response

Environment 🖥

System: OS: Windows 10 10.0.22000 CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor Memory: 4.38 GB / 15.95 GB Binaries: Node: 16.13.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.22000.120.0), Chromium (96.0.1054.62) Internet Explorer: 11.0.22000.120
npmPackages: next: 12.0.10 => 12.0.10 next-auth: ^4.2.1 => 4.2.1 react: 17.0.2 => 17.0.2

Contributing 🙌🏽

Yes, I am willing to help solve this bug in a PR

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:30 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
lakshyasharma14commented, Feb 14, 2022

Can you guys try passing httpOptions with timeout like shown below (40000 is in ms)and check the error, now it won’t timeout because of openid-client, but you’ll see some error due to network issue with google/github auth server from there you can further check the issue.

GoogleProvider({
      clientId: process.env.GOOGLE_ID,
      clientSecret: process.env.GOOGLE_SECRET,
      httpOptions: {
        timeout: 40000,
      },
    }),
3reactions
panvacommented, Feb 12, 2022

No bug in sight, your Node.js process may not be able to reach google servers for a variety of local network / network setup related reasons.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request timed out while trying to do Google Auth in Node.js ...
(PS: looking at the documentation, the OpenID-based Google authenticator that you seem to be using will only pass two arguments to the ...
Read more >
6 Easy Ways to Fix Err Connection Timed Out Error in Chrome
Err Connection Timed Out is the most common error which is often seen in Google Chrome.Here we're explaining how to fix “ERR_SSL_PROTOCOL_ERROR”.
Read more >
11 Ways to Fix the ERR_CONNECTION_TIMED_OUT Error
When your internet connection times out and you can't access a specific webpage, it's one of the most annoying errors.
Read more >
How to Fix the ERR_CONNECTION_TIMED_OUT Error - Kinsta
Simply put, it's an indication that the system is unavailable and the time given for one to connect has elapsed, and now the...
Read more >
Setting request timeout (services) | Cloud Run Documentation
You can set request timeout using the Google Cloud console, the gcloud command line, or a YAML file when you create a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found