replace atob with Buffer

master
Tudor Stanciu 2023-03-29 20:05:54 +03:00
parent aba635b7cc
commit eec7701125
1 changed files with 2 additions and 1 deletions

View File

@ -10,7 +10,8 @@ const decodeToken = (): TuitioTokenData | null => {
const authData = getItem(storageKeys.AUTH_DATA);
if (!authData) return null;
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));
return decodedToken;
};