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

InternalOAuthError: Failed to fetch user profile #84

Open
cubasia opened this issue Jul 20, 2022 · 0 comments
Open

InternalOAuthError: Failed to fetch user profile #84

cubasia opened this issue Jul 20, 2022 · 0 comments

Comments

@cubasia
Copy link

cubasia commented Jul 20, 2022

I got this error
InternalOAuthError: Failed to fetch user profile
at C:\Esercizi\node2\node_modules\passport-github2\lib\strategy.js:98:19
at ClientRequest. (C:\Esercizi\node2\node_modules\oauth\lib\oauth2.js:162:5)
at ClientRequest.emit (node:events:537:28)
at TLSSocket.socketErrorListener (node:_http_client:465:9)
at TLSSocket.emit (node:events:537:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

const githubStrategy = new passportGitHub2.Strategy(
{
clientID: config.CLIENT_ID,
clientSecret: config.CLIENT_SECRET,
callbackURL: config.CALLBACK_URL,
// skipUserProfile: true

},
function (
accesToken: string,
refreshToken: string,
profile: { [key: string]: string },
done: (error: null, user: Express.User) => void
) {
const user: Express.User = {
username: profile.username,
};

done(null, user);

}
);

I am afraid this fail and i don'know why
passport.authenticate("github", {
scope: ["user:email"],
})

I double checked the ID and secret and the call back url. It's all fine, even the call backurl is fine and I can contact github.
I am able to receive the login page of github, authorize the use but then i receive this error. Any clue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant