When I try to decode the tokens using Jwtdecode, it just gives me this error message:
Warning: An unhandled error was caught from submitForm() [InvalidTokenError: Invalid token specified: invalid base64 for part #2 (Property ‘atob’ doesn’t exist)]
This is how my code looks:
import { jwtDecode } from "jwt-decode";
//.
//.
//.
const handleSumbit = async ({ email, password }) => {
const result = await authApi.login(email, password);
if (!result.ok) return setLoginFailed(true);
setLoginFailed(false);
const token = result.data;
const decoded = jwtDecode(token);
console.log(decoded);
};