diff --git a/src/token.ts b/src/token.ts index de1dee1..c6aa3c8 100644 --- a/src/token.ts +++ b/src/token.ts @@ -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; };