2.0.0 • Published 7 years ago

jwt-parser v2.0.0

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

jwt-parser

NPM Version NPM Downloads Node.js Version Build Status

Generic JWT Authorization header field parser for whatever.

Installation

$ npm install jwt-parser

API

var auth = require('jwt-parser')

auth(req, secret)

Get the JWT payload from the given request. JWT secret also required so it can decode and get payload correctly. The Authorization header is parsed and if the header is invalid, undefined is returned, otherwise will return decode jwt payload.

Example

var auth = require('jwt-parser');
var user = auth(req, secret);

License

MIT