How to decode JWT Token payload on client side?
<p>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:</p>

<pre><code>var payload = JSON.parse(window.atob(token.split('.')[1])); 
</code></pre>

<p>Is there a better way to work with jwt tokens within the browser? </p>