I have confirmed that i am sending right token which i am receiving as from auth0, also i verified the token at jwt.io.
But still receiving same issue.
same token i passed to custom function like below then it give m the user details but when i am calling it with auth0.getUser method i am receiving the error.
const getUser = async (token) => {
try {
const response = await axios.get("https://<here passed auth0 tenant>.us.auth0.com/userinfo", {
headers: {
Authorization: `Bearer ${token}`,
},
});
return response.data
} catch (error) {
console.error('Error making API request:', error.message);
}
}
const user = await getUser(response.access_token)