egg-passport-wechat-ts
v1.1.0
Published
Wechat passport plugin for egg, support multiple clients
Downloads
12
Maintainers
Readme
egg-passport-wechat
Wechat passport plugin for egg.
Example
Open https://uniheart.herokuapp.com/ on your wechat browser to see the result:
- Open your wechat
- Scan the following QR Code to follow the test public account:
- And then scan the following QR Code to open the example site:
Install
$ npm i egg-passport-wechat-ts --save
Usage
// {app_root}/config/plugin.[t|j]s
exports.passportWechat = {
enable: true,
package: "egg-passport-wechat-ts"
};
Configuration
Single instance example:
// {app_root}/config/config.default.[t|j]s
exports.passportWechat = {
key: "your oauth key",
secret: "your oauth secret"
};
Multiple instances example:
// {app_root}/config/config.default.[t|j]s
exports.passportWechat = {
clients: {
wechat1: {
key: "your oauth key",
secret: "your oauth secret"
},
wechat2: {
key: "your oauth key",
secret: "your oauth secret"
}
}
};
see config/config.default.ts for more detail.
Example
- https://uniheart.herokuapp.com/passport/wechat
app.passport.mount("wechat", app.config.passportWechat);
Questions & Suggestions
Please open an issue here.
License
Test
npm run test-local