Skip to content

Instantly share code, notes, and snippets.

@shashinvision
Forked from Klerith/parse-jwt.js
Created September 11, 2023 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shashinvision/9d9adfffd2db9a2402227e2b2e75d69d to your computer and use it in GitHub Desktop.
Save shashinvision/9d9adfffd2db9a2402227e2b2e75d69d 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));
};
@shashinvision
Copy link
Author

JWT Parse

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