1.0.0 • Published 11 months ago

@luca.salzone/tokenverify v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

Token Validation

Description

This package is used to validate and decode JWT token created with RS256 private Key.

To validate and decode you need to use public key.

How to Use

In this example we can see how to use this package:

const verifyAndDecodeToken = require('./tokenValidation');
const token = '...';
const publicKeyPath = './nginx-certificate.crt';
const decodedToken = verifyAndDecodeToken(token, publicKeyPath);

if (decodedToken) {
  console.log(decodedToken);
} else {
  // here you must manage error
}
1.0.0

11 months ago