Nest-Passport won't initiate


#1

I’m trying to add Nest authentication to sails using Passport-Nest, however I am having some issues getting it to work.

My sails template I am using is this: https://github.com/greghesp/sails-passport.

It’s my own project, and I’ve got Facebook, Local and Google authentication working fine.

Hopefully someone can help me figure out what I’m doing wrong.

passport.js

//Authenticate as Nest
passport.use(new NestStrategy({
  clientID: '123',
  clientSecret: 'abc'
},
function(req, done){
  console.log(req);
  return done(req.user.accessToken);
}));

authcontroller.js

nest: function(req, res){
	console.log('nest cb');
	passport.authenticate('nest',{}), function(token){
		console.log('Token is ' +  token);
	}
},

I then call http://localhost:1337/auth/nest and have the callback in my Nest app set as http://localhost:1337/auth/nest/callback

My authcontroller function is triggering as ‘nest cb’ is being logged, however it does not proceed to opening the Nest authentication page.

Any suggestions?