Skip to content

Instantly share code, notes, and snippets.

@intelguasoft
Created September 13, 2018 00:45
Show Gist options
  • Save intelguasoft/c83040fc803d8a33a3d90114056a7bbd to your computer and use it in GitHub Desktop.
Save intelguasoft/c83040fc803d8a33a3d90114056a7bbd 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));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment