Skip to content

Instantly share code, notes, and snippets.

@rafaelsq
Created August 22, 2017 14:38
Show Gist options
  • Save rafaelsq/1c3756257aa10fac7d059c3851c76d4a to your computer and use it in GitHub Desktop.
Save rafaelsq/1c3756257aa10fac7d059c3851c76d4a to your computer and use it in GitHub Desktop.
Parse JWT base64 string
const parseJwt = token => JSON.parse(window.atob(token.split('.')[1].replace('-', '+').replace('_', '/')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment