Member-only story
Auth0 React — 401 token error
So you’re trying to use Auth0 in your React (or any other SPA) application, and you follow their tutorial to the tee, but yet, it’s not working.
isLoading is false
user is undefined
isAuthenticated is false
What on Earth is going on?
I too was in your position, for a whole hour.
If you noticed it, the Network tab would list a failed request, with an error code of 401, with the response of:
{"error":"access_denied","error_description":"Unauthorized"}
The cause? An error in the configurations despite you having correctly selected ‘Single Page Application’.
The fix? Go to your Application’s settings, head to the Credentials tab and set the Method to ‘None’
In my case, and probably in yours, the Method was set to ‘Client Secret (Post). Which would be applicable if you were trying to communicate with the client via your backend.
That’s the fix, happy building!