1.0.2 • Published 7 years ago
is-jwt-valid v1.0.2
Is JWT Valid
Pass a JWT token and get a boolean if the token is valid, the requirements for a valid token are defined by the official RFC 7519 standard
Install
npm
npm install is-jwt-validyarn
yarn add is-jwt-validUsage
isJwtValid(JWT_TOKEN<STRING>)Example
isJwtValid('this is no valid token') // returns false
isJwtValid('some.valid.token') // returns trueSupport
Browser
Under the hood it uses the window.atob() native feature which is supported in each major browser and IE from version 10 (check mozilla dev site)
Node
Uses the native Buffer API from node (check node documentation)