Skip to content

Instantly share code, notes, and snippets.

@wcdz
Forked from Klerith/parse-jwt.js
Created June 23, 2022 21:23
Show Gist options
  • Save wcdz/c8d085c6a39e88558806fc75ba54f2d6 to your computer and use it in GitHub Desktop.
Save wcdz/c8d085c6a39e88558806fc75ba54f2d6 to your computer and use it in GitHub Desktop.
Parse - JWT - Obtener Payload y fecha de creación y expiración
function parseJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
};
@wcdz
Copy link
Author

wcdz commented Jun 23, 2022

Código para leer el payload y fecha de expiración de un Token - NO USAR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment