This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
hymenobacterdotinfo/app/utils/parse-base64.js
2015-06-23 18:47:47 -08:00

8 lines
176 B
JavaScript

export default function parseBase64(token) {
let tokenData = atob(token.split('.')[1]);
try {
return JSON.parse(tokenData);
} catch (e) {
return tokenData;
}
}