passport / discuss

A forum for discussing topics related to the usage of Passport.js.
1 stars 0 forks source link

Problems when using oAuth 2.0 with Google and Facebook #44

Open samyadel opened 4 years ago

samyadel commented 4 years ago

In my web app, I starting using oAuth 2.0 with google and it worked. So I decded to also use oAuth 2.0 with Facebook. There is one problem though; it doesn't work if I use oAuth 2.0 with google So if a user registers using google, his information will be stored in the database. However if another user registers using facebook, it will throw an error. The only way to fix this error is to clear the database. When I do, it works for facebook, but this time oAuth 2.0 using google doesn't work. It throws the same error: MongoError: E11000 duplicate key error collection: usersDB.users index: username_1 dup key: { username: null }