I'm using a jwt token for authentication and would like to read the payload information on the client-side. Right now I'm doing something like this:
var payload = JSON.parse(window.atob(token.split('.')[1]));
Is there a better way to work with jwt tokens within the browser?