this authenticate works fine and I get a redirect:
server.post(authPostRoute, passport.authenticate( 'local' , { successRedirect: '/', failureRedirect: '/login' } ));
this authenticate hangs after the call back is called:
server.post(authPostRoute, passport.authenticate( 'local' , function(){ console.log('Hitting the callback'); console.log(arguments)} ));
this logs the following piece:
{ '0': null, '1': { id: [Getter/Setter], firstName: [Getter/Setter], lastName: [Getter/Setter], email: [Getter/Setter], addedOn: [Getter/Setter], active: [Getter/Setter], password: [Getter/Setter] }, '2': undefined }
But throughout the documentation (http://passportjs.org/guide/authenticate/) it looks as though it shuold be passed req and res, but it obviously isn't. Then the code that calls the callback:
node_modules\passport\lib\middleware\authenticate.js
strategy.success = function(user, info) { if (callback) { return callback(null, user, info); }
doesn't pass those parameters. What am I doing wrong?