jwt-parser

    2.0.0 • Public • Published

    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

    Install

    npm i jwt-parser

    DownloadsWeekly Downloads

    62

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • ferrari