jwtDecode.js 220 B

1234567891011
  1. function jwtDecode (token) {
  2. try {
  3. const base64Url = token.split('.')[1];
  4. const base64 = atob(base64Url);
  5. return JSON.parse(base64);
  6. } catch (err) {
  7. console.log(err);
  8. }
  9. }
  10. export default jwtDecode;