passport-google-token icon indicating copy to clipboard operation
passport-google-token copied to clipboard

Request pending

Open mmahalwy opened this issue 9 years ago • 1 comments

See:

import { Strategy as GoogleStrategy } from 'passport-google-token';
import passport from 'passport';
import { Router } from 'express';
import { User } from './models';
const router = Router();

passport.use(new GoogleStrategy({
    clientID: 'CLIENT',
    clientSecret: 'SECRET',
  },
  function(accessToken, refreshToken, profile, done) {
    User.create({metaData: profile}).then(function(user, err) {
      done(null, user, user);
    });
  }
));



router.post('/google/callback',
  passport.authenticate('google-token'),
  function(req, res) {
    console.log('HERE!!!!');
    res.send('req');
    // Successful authentication, redirect home.
  }
);

export default router;

For some reason it stays as pending request...

mmahalwy avatar Dec 07 '15 04:12 mmahalwy

Did you notice that you send the access token and not the token id to the server?

Rotemy avatar Dec 16 '15 14:12 Rotemy