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

Pending Callback #209

Open
Millen31 opened this issue Jul 1, 2017 · 1 comment
Open

Pending Callback #209

Millen31 opened this issue Jul 1, 2017 · 1 comment

Comments

@Millen31
Copy link

Millen31 commented Jul 1, 2017

Hello,

I've some problem with Passport-Facebook. My Callback is pending for 1 Minute and then the error "FacebookTokenError: This authorization code has been used." appears. But I have this problem with just some users. If I login with my personal account, everything works fine. If I use an test user from Facebook, this error appears.

image

I'm using passport 0.3.2 and passport-facebook": "2.1.1",

My Code:

app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['user_hometown', 'user_friends', 'public_profile', 'email' ] })); app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/', failureRedirect: '/login/' }));

passport.use(new FacebookStrategy({ clientID: config.facebook.clientID, clientSecret: config.facebook.clientSecret, callbackURL: config.facebook.callbackURL, profileFields: ['id', 'displayName', 'first_name', 'middle_name', 'last_name','email', 'photos', 'hometown'] }, function(req, accessToken, refreshToken, profile, done) {...

Does anybody have an idea?

Thank and best regards

@kyohei8
Copy link

kyohei8 commented Jul 8, 2017

Are not you calling done()?

passport.use(new FacebookStrategy({...}, 
function(req, accessToken, refreshToken, profile, done) {
  // do something...

  process.nextTick(function () {
    return done(null, profile);  // <- call this
  });
  
});

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

2 participants