Open TroutNemesis opened 7 years ago
Hm, that is curious. It looks like the Passport session isn't being initialized. Are you using the default (memory) session store?
Idk I followed the tutorial/copied the repo pretty exactly. Where does one set the type of memory session?
I also get this error regarding _passport.session
being undefined. I guess session store should be enabled by default thus session initialization should work. But it doesn't, does anyone know why?
Did anyone figure out a solution to this issue? I'm running into the same thing and not making any headway on it ...
res.login in the UserController is not constructed properly - commented out are 2 examples of how to properly pass the required User, Object and callback Function to passport/index.js.
In UserController.js CHANGE
login: function (req, res) { return res.login({ successRedirect: '/' }); },
TO
login: function (req, res) { return req.login({user: req.params.all()}, function(err){ if(err) return res.notFound(null, 'user/signup'); return res.view('/'); }); },
I need Help 👍 Unhandled rejection TypeError: Cannot set property 'user' of undefined
TypeError: Cannot set property 'user' of undefined at /Users/matthewlinford/Desktop/Positive_Learning/ell-admin/api/hooks/passport/index.js:160:31 at pass (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/node_modules/passport/lib/authenticator.js:267:43) at serialized (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/node_modules/passport/lib/authenticator.js:276:7) at /Users/matthewlinford/Desktop/Positive_Learning/ell-admin/api/hooks/passport/index.js:66:6 at pass (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/node_modules/passport/lib/authenticator.js:284:9) at Authenticator.serializeUser (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/node_modules/passport/lib/authenticator.js:289:5) at req.login.req.logIn (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/api/hooks/passport/index.js:155:26) at afterVerifyingCredentials (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/api/responses/login.js:119:10) at Strategy.strategy.success (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/node_modules/passport/lib/middleware/authenticate.js:201:18) at verified (/Users/matthewlinford/Desktop/Positive_Learning/ell-admin/node_modules/passport-local/lib/strategy.js:83:10) at /Users/matthewlinford/Desktop/Positive_Learning/ell-admin/api/responses/login.js:93:12
I get the above error whenever I try to login. I haven't meddled with the hook you wrote. Any ideas on what might be causing this?