passport-wechat-mp
Wechat Mini Program authentication strategy for Passport.
Install
$ npm install passport-wechat-mp# yarn add passport-wechat-mp
Usage
Configure Strategy
const WechatMPStrategy = Strategy; passport
Strategy constructor options:
appId
: String, required, wechat miniprogram appid.appSecret
: String, required, wechat miniprogram app secret.name
: String, optional, strategy name. Default aswechat-mp
.authorizationURL
: String, optional, url to fetch wechat session key by code, check wechat doc for more details. Default ashttps://api.weixin.qq.com/sns/jscode2session
.
Authenticate Requests
const passport = ; app;
Test
$ npm test# yarn test
TODO
- Strategy unit test