perfood / couch-auth

Powerful authentication for APIs and apps using CouchDB (or Cloudant) with Node >= 14
MIT License
68 stars 19 forks source link

🐛 Fix OAuth errors and update documentation. #12

Closed ErikGoH closed 3 years ago

ErikGoH commented 3 years ago

📝 Update the providers section in README.

ErikGoH commented 3 years ago

With this changes I was able to authenticate with google and facebook providers.

  providers: {
    google: {
      credentials: {
        clientID: process.env.GOOGLE_CLIENT_ID,
        clientSecret: process.env.GOOGLE_CLIENT_SECRET,
      },
      options: {
        scope: ['email'],
      },
      stateRequired: false,
    },
    facebook: {
      credentials: {
        clientID: process.env.FACEBOOK_APP_ID,
        clientSecret: process.env.FACEBOOK_APP_SECRET,
        profileFields: ['emails'], // facebook needs this property otherwise does not send the email
        //  and superlogin complains with the next error 'An email is required for registration, but facebook didn't supply one.'
      },
      options: {
        scope: ['email', 'public_profile'],
      },
      stateRequired: false,
    },
  },