I am following this blog post on how to use the auth0-react library.
The post describes using the getAccessTokenSilently from the useAuth0 hook to get the access token which is used as the bearer token
const callSecureApi = async () => {
try {
const token = await getAccessTokenSilently();
const response = await fetch(`${apiUrl}/api/private-message`, {
headers: {
Authorization: `Bearer ${token}`,
},
});
const responseData = await response.json();
setMessage(responseData);
} catch (error) {
setMessage(error.message);
}
};
The issue I'm having is the token doesn't appear to be a JWT token - it looks like:
RJq7USOcszn7rpyI5iDjbYAKp9pK60Ap
Does anyone know why getAccessTokenSilently isn't returning a JWT token?
RJq7USOcszn7rpyI5iDjbYAKp9pK60Apor similar) is not a bearer token. - Vinyl Warmth