node-express-mongodb-jwt-rest-api-skeleton icon indicating copy to clipboard operation
node-express-mongodb-jwt-rest-api-skeleton copied to clipboard

PassportJS based Social auth feature

Open solancer opened this issue 5 years ago • 3 comments

Email signup and login is getting outdated lately and people prefer oAuth based logins from their existing logins. Add passport strategies for Facebook, Google, Twitter, Github.

solancer avatar Apr 11 '20 16:04 solancer

I prefer email based always. But some other people might like oAuth. Can you please help out with this? You are more than welcome to create a PR for this. Thanks!

davellanedam avatar Apr 11 '20 17:04 davellanedam

Hello, I am having an error on this line when retrieving /profile data.

I did console log the user and is ok, but somehow something is not right with the callback.

Where should I be looking?

const jwtLogin = new JwtStrategy(jwtOptions, (payload, done) => { User.findById(payload.data._id, (err, user) => { if (err) { return done(err, false) } return !user ? done(null, false) : done(null, user) }) })

error TypeError: callback is not a function at JwtStrategy.strategy.success

Any Idea what might be wrong?

Thanks a lot

macizomedia avatar May 27 '20 15:05 macizomedia

Hello, I am having an error on this line when retrieving /profile data.

I did console log the user and is ok, but somehow something is not right with the callback.

Where should I be looking?

const jwtLogin = new JwtStrategy(jwtOptions, (payload, done) => { User.findById(payload.data._id, (err, user) => { if (err) { return done(err, false) } return !user ? done(null, false) : done(null, user) }) })

error TypeError: callback is not a function at JwtStrategy.strategy.success

Any Idea what might be wrong?

Thanks a lot

Hey I just saw this, I am sorry, you should have opened a new issue, this issue is an enhancement. Were you able to solve your issue? Please Let's move this to a new issue if you still haven't solved this yet. If you did, can you please delete the comment so we keep this thread as an enhancement? Thanks, and I am really sorry again.

davellanedam avatar Jul 30 '20 22:07 davellanedam