#JWT TOKEN

2 messages · Page 1 of 1 (latest)

sacred kestrel
#

there are many library to decode a JWT, but without using libraries:

function jwtDecode(t) {
  let token = {};
  token.raw = t;
  token.header = JSON.parse(window.atob(t.split('.')[0]));
  token.payload = JSON.parse(window.atob(t.split('.')[1]));
  return (token)
}

source: https://stackoverflow.com/a/47115113/11703367

#

g!badeyes @fathom chasm