React Authentication By Example: React Router 6

Hi, is there any guidance on how to perform auth checks and access the bearer token in React Router’s new loaders and actions? The challenge is these sit above/outside of the Auth0Provider component.

This was also asked here under point 2.


[Answered]

I found a good solution here using the “@auth0/auth0-spa-js” package.