passport-hlg
v1.0.5
Published
passport strategy for authenticating with hlg
Downloads
4
Readme
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.