egg-jwt
Deepexi Egg's JWT(JSON Web Token Authentication Plugin)
Install
$ npm i @jackyhweng/egg-jwt --save
Usage
exports.jwt = {
enable: true,
package: "@jackyhweng/egg-jwt"
};
Configuration
'use strict';
exports.jwt = {
enable: true,
match: ['/*']
};
see config/config.default.js for more detail.
Example
"use strict";
module.exports = app => {
app.get('/test',app.controller.test.index);
};
("use strict");
module.exports = app => {
class SuccessController extends app.Controller {
index() {
console.log('query body : ', this.ctx.query);
this.ctx.body = this.ctx.query;
}
}
return SuccessController;
};
Questions & Suggestions
Please open an issue here.
License
MIT