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-10-30 09:22:19 -07:00

9 lines
187 B
JavaScript

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