Nodejs decode JWT payload code example
Example 1: js jwt decode
import jwt_decode from "jwt-decode";
var token = "eyJ0eXAiO...";
var decoded = jwt_decode(token);
console.log(decoded);
/* prints: * { foo: "bar", * exp: 1393286893, * iat: 1393268893 } */
Example 2: decode jwt token nodejs
var ca = yourToken;
var base64Url = ca.split('.')[1];
var decodedValue = JSON.parse(window.atob(base64Url));