cookie-jwt
v1.0.3
Published
Tiny wrapper function for got jwt payload form cookie
Downloads
1,888
Readme
Tiny wrapper function for get jwt payload from cookie
Description
This library is wrapper function combinate cookie
and jwt-decode
Usage
var cookieJwt = require('cookie-jwt')
var payload = cookieJwt(document.cookie, 'my-jwt-token-key')
// payload like below:
// { admin: true, name: 'John Doe', sub: '1234567890' }
API
cookieJwt(cookieString
, jwtTokenKey
)
- Return jwt payload.
- If a got parse error, this function return empty object (like
{}
)