davellanedam / node-express-mongodb-jwt-rest-api-skeleton

This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API). Demo of frontend in VueJS here: https://github.com/davellanedam/vue-skeleton-mvp
MIT License
889 stars 290 forks source link

PassportJS based Social auth feature #199

Open solancer opened 4 years ago

solancer commented 4 years ago

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.

davellanedam commented 4 years ago

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!

macizomedia commented 4 years ago

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

davellanedam commented 3 years ago

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.