added User Context

This commit is contained in:
Sean Macfarlane
2020-05-08 14:08:44 -04:00
parent 20047113bb
commit 5f3ab23ee1
4 changed files with 44 additions and 11 deletions

View File

@@ -1,7 +1,6 @@
export function parseJwt(token) {
const base64Url = token.split('.')[1];
const base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
const base64Url = token.split('.')[0];
return JSON.parse(window.atob(base64Url));
}
export function isTokenExpired(token) {