0.0.9 • Published 6 years ago

chewb-passport v0.0.9

Weekly downloads
3
License
-
Repository
github
Last release
6 years ago

Plug this into a Chewb instance.

example.js

Config

let Strategies = [{
  name: 'facebook',
  clientId: process.env.FACEBOOK_ID,
  clientSecret: process.env.FACEBOOK_SECRET,
  authUrl: '/login/facebook',
  redirectUrl: '/login/facebook/return',
  callbackUrl: `http://localhost:8080/login/facebook/success`
}]

authUrl From your app open a popup window at this address.

redirectUrl This is required by oAuth2

callbackUrl Have a timer watching the popup window url to read back the auth tokens.

Use

let chewbPassport = new ChewbPassport(
  server.app, //chewb server
  Strategies,
   {
    host: `http://${server.host}:${server.port}/`,
    baseRoute: '', //this will prepend the 'Url' in the config.
    logOut: true //force logout
  })