0.0.5 • Published 7 years ago

egg-passport-weixin v0.0.5

Weekly downloads
23
License
MIT
Repository
github
Last release
7 years ago

egg-egg-passport-weixin

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-passport-weixin --save

Usage

// {app_root}/config/plugin.js
exports.passportWeixin = {
  enable: true,
  package: 'egg-passport-weixin',
};

Configuration

// {app_root}/config/config.default.js
exports.passportWeiXin = {
  clientID: '',
  secret: '',
  callbackURL: '/auth/weixin/callback',
  scope:'snsapi_userinfo',
};

see config/config.default.js for more detail.

Example

// {app_root}/app/router.js
app.get("/auth/weixin", app.passport.authenticate('loginByWeixinClient'));

app.get("/auth/weixin/callback",app.passport.authenticate('loginByWeixinClient',{ successRedirect: '/test/hello',failureRedirect: '/login' })
    );

Questions & Suggestions

Please open an issue here.

License

MIT

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago