Skip to content

Instantly share code, notes, and snippets.

@rendro
Created August 25, 2015 12:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rendro/687a166957c3910acd1c to your computer and use it in GitHub Desktop.
Save rendro/687a166957c3910acd1c to your computer and use it in GitHub Desktop.
Simple decode of JWT claims
function jwtDecode(token) {
const [header, claims, signature] = token.split('.');
try {
return JSON.parse(atob(claims));
} catch (e) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment