Description
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?