replace atob with Buffer
parent
aba635b7cc
commit
eec7701125
|
@ -10,7 +10,8 @@ const decodeToken = (): TuitioTokenData | null => {
|
||||||
const authData = getItem(storageKeys.AUTH_DATA);
|
const authData = getItem(storageKeys.AUTH_DATA);
|
||||||
if (!authData) return null;
|
if (!authData) return null;
|
||||||
const { token } = authData;
|
const { token } = authData;
|
||||||
const decodedTokenString = atob(token);
|
const decodedTokenBuffer = Buffer.from(token, "base64");
|
||||||
|
const decodedTokenString = decodedTokenBuffer.toString("utf-8");
|
||||||
const decodedToken = camelizeKeys(JSON.parse(decodedTokenString));
|
const decodedToken = camelizeKeys(JSON.parse(decodedTokenString));
|
||||||
return decodedToken;
|
return decodedToken;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue