Skip to content

renrenche/express-jwt-sign

Repository files navigation

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

About

jwt signature generator for express

Resources

License

Stars

Watchers

Forks

Packages

No packages published