@onspark/jwt-read
v0.0.4
Published
Jwt read functions
Readme
Jwt read utility
Main Functionality
This is a collection of jwt reading functions.
Main functions
const jwtReader = require( '@chatpta/jwt-read' );Read jwt
const jwtMiddleware = jwtReader.verifyJwtAndRole( "admin", publicKey, jwtReader.throwUsedTokenError );
await jwtMiddleware( req, res, next );Following the above req.jwt contains
{
header: {
alg:...
}
,
payload: {
...
}
}