1.0.3 • Published 7 years ago

express-jwt-sign v1.0.3

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

express-jwt-sign

jwt signature generator for express

Installation

$ npm install --save express-jwt-sign

Usage

const express = require('express');
const jwtsign = require('express-jwt-sign');
const appId = 'fe/star';
const appSecret = 'xxx';    // 这两个参数需要保密

const app = express();
app.use(jwtsign(appId, appSecret, {
    pathPattern: /\/star\/evaluations\//,   // ignore to generate jwt signature on all requests
    expireInSeconds: 60,                    // default to 1 hour
});

app.use(function (req, res, next) {
    console.log(req.__jwtsignature);
});

License

MIT © wangshijun