egg-authing
Install
$ npm i egg-authing --save
Usage
To enable Authing plugin, you should change ${baseDir}/config/plugin.js
// {app_root}/config/plugin.jsexportsauthing = enable: true package: 'egg-authing';
Configuration
Single Instance
// {app_root}/config/config.default.jsexportsauthing = client: clientId: '' secret: '' ;
Multiple Instances
// {app_root}/config/config.default.jsexportsauthing = clients: pool1: clientId: 'your_client_id' secret: 'your_client_secret' pool2: clientId: 'your_client_id' secret: 'your_client_secret' ;
see config/config.default.js for more detail.
Example
const ctx = this; const user = await ctxauthing;
//Multiple instances example const ctx = this; const userPool1 = await ctxauthing; const userPool2 = await ctxauthing;
Questions & Suggestions
Please open an issue here.