abstract-purpleA
Refineโ€ข4y agoโ€ข
6 replies
abstract-purple

Auth0 authProvider and dataProvider async problem

I have an Auth0 login on my Refine frontend. Once I'm logged in I pass my token to the backend via the Authorization header as a bearer token. The issue is that Refine does not wait for the checkAuth to return true before making requests to the dataProvider which requires auth. Since Auth0 is async, the first couple of queries on page reload will fail. How do I prevent Refine from starting to query resources before the user is logged in? I can't wrap <Refine> because I need to have the login page.
Was this page helpful?