passport-hlg

1.0.5 • Public • Published

passport-hlg v1.0.3

##支持功能

  • 欢乐逛统一登录

安装

$ npm install passport-hlg

使用

Configure Strategy

 passport.use(new HLGStrategy({
        appID: {APPID},
      },
      function(user, done) {
          if (user && user.userid) {
              done(null, user)
          } else {
              done(null, false)
          }
      }
));

Authenticate Requests

  router.get('/auth/hlg', passport.authenticate('hlg', {
    failureRedirect: '/auth/fail',
    successReturnToOrRedirect: '/'
  }));

If no callbackURL is specified, the same request url will be used.

Authentication Callback

  router.get('/auth/wechat/hlg', passport.authenticate('hlg', {
    failureRedirect: '/auth/fail',
    successReturnToOrRedirect: '/'
  }));

License

Copyright (c) 2016 Sharkseven
Licensed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i passport-hlg

Weekly Downloads

7

Version

1.0.5

License

MIT

Unpacked Size

4.89 kB

Total Files

4

Last publish

Collaborators

  • sharkseven