Skip to content

Instantly share code, notes, and snippets.

@Klerith
Created March 15, 2018 15:07
Show Gist options
  • Save Klerith/44ee5349fa13699d9c5f1e82b3be040e to your computer and use it in GitHub Desktop.
Save Klerith/44ee5349fa13699d9c5f1e82b3be040e 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));
};
@Alexis06cs
Copy link

Genial

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