Request timed out after 3500ms #3186
-
react: 17.0.2 Provider: custom oidc We're experiencing "openid-client" timeouts during the authentication process using a less than optimal auth server, and thus need to increase the default timeout slightly. Stacktrace:
It's an error message from the "openid-client" package which has a default timeout value of 3500ms. The solution would be to set an increased default timeout value: https://github.com/panva/node-openid-client/tree/main/docs#customizing Specifically: import { custom } from 'openid-client';
custom.setHttpOptionsDefaults({
timeout: 5000,
}); I don't seem to be able to trigger a I've tested calling Are there any current way of setting the "openid-client" timeout in Next Auth that I have missed? If there are no current solution for this I would be happy to make a PR if this sounds reasonable. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 9 replies
-
Right... Similar to what we had to do here: next-auth/src/core/lib/oauth/client.ts Line 45 in 043b252 I'll think of a way to make this easier to configure. |
Beta Was this translation helpful? Give feedback.
-
Opened a PR to expose this option: #3188. We can try to start being restrictive and open up for new options if there is interest later on. Here is an experimental release if you want to test it out: #3188 (comment) |
Beta Was this translation helpful? Give feedback.
-
@jorabra What did you end up setting the timeout to? I increased it to 10 seconds but it keeps hanging causing my lambda to abort. |
Beta Was this translation helpful? Give feedback.
-
this is still happening on latest versions |
Beta Was this translation helpful? Give feedback.
-
It's almost 2024, (~4yrs after this issue was created), Yet I still experience this error :( |
Beta Was this translation helpful? Give feedback.
-
21st of December 2023 I noticed it is only happening on localhost it is working on live working deployed on netlify fixed it by adding timeout GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
profile(profile) {
return {
id: profile.sub,
name: `${profile.given_name} ${profile.family_name}`,
email: profile.email,
image: profile.picture,
emailVerified: profile.email_verified,
role: profile.role ? profile.role : "user",
};
},
httpOptions: {
timeout: 10000,
}
}), |
Beta Was this translation helpful? Give feedback.
-
I set the timeout under httpOptions to 100000 and it worked for me |
Beta Was this translation helpful? Give feedback.
Opened a PR to expose this option: #3188.
We can try to start being restrictive and open up for new options if there is interest later on.
Here is an experimental release if you want to test it out: #3188 (comment)