This package has been deprecated

Author message:

No longer maintained.

express-jwt-handler

0.2.2 • Public • Published

express-jwt-handler Build Status

Verifies received JSON Web Token and sets the current user based on issuer.

Install

$ npm install --save express-jwt-handler

Usage

var express = require('express');
var jwtHandler = require('express-jwt-handler');

var app = express();

// Use as middleware and pass the secret
app.use(jwtHandler('secret123'));

app.get('/user', function (req, res, next) {
  // req.user_id is set to JWT issuer
});

The secret can also be set as an environment variable called JWT_SECRET.

Send the JSON Web Token as Authorization: Bearer TOKEN.

License

MIT © Richard Käll

Package Sidebar

Install

npm i express-jwt-handler

Weekly Downloads

6

Version

0.2.2

License

MIT

Last publish

Collaborators

  • npm