Skip to content

Instantly share code, notes, and snippets.

@rendro
Created August 25, 2015 12:24
Show Gist options
  • 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