-
Notifications
You must be signed in to change notification settings - Fork 11
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
Function after passport.use not working #4
Comments
Hi @Bertieio You're code looks good from what I can tell so far. I also couldn't reproduce this issue (of course with custom clientId, clientSecret and baseUrl). Do you might have any more details about the error:
The callback should actually be invoked, as soon as the callback URL is triggered. Cheers |
Thanks for the reply @fh1ch
|
EDIT: Just saw the closed issue #9 and double checked my version, I'm using passport-gitlab2 4.0.0 so this issue might still remain (or it's my implementation) I have the same issue (more or less) my passport.use function: passport.use(
new gitlabStrategy({
clientID: keys.gitlab.clientID,
clientSecret: keys.gitlab.clientSecret,
callbackURL: "/auth/gitlab/redirect",
baseURL: "https://redacted.domain.com/"
}, function(accessToken, refreshToken, profile, cb) {
//callback, seems to be broken
console.log(profile);
})
); here are my routes: // Authenticate with gitlab
router.get("/gitlab", passport.authenticate('gitlab', {
scope: ['openid']
}));
// callback redirect from gitlab authentication
// WARNING: the passport.authenticate() as middleware crashes with InternalOAuthError: Failed to fetch user profile
router.get('/gitlab/redirect', passport.authenticate('gitlab'), function (req, res) {
res.send('you reached the gitlab callback route') //demo
}); It works as long as i don't use Here is the error I get both in browser and in terminal when it fails:
Server running on my localhost and no issue while going back and fourth between gitlab has been detected. It works without the callback to passport as middleware. Hopes this information helps resolve the issue, best regards |
I am unable to get the
to fire when authenticating
Full code
The text was updated successfully, but these errors were encountered: