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 }
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 }