function decodeJWT(jwtToken) {
const payloadBase64 = jwtToken.split('.')[1];
const payloadString = atob(payloadBase64);
const payloadJSON = JSON.parse(payloadString);
return payloadJSON;
}
const jwtToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c';
const payload = decodeJWT(jwtToken);
console.log(payload);