sacred-emeraldS
Refine3y ago
10 replies
sacred-emerald

useIsAuthenticated infinite re-renders

I had a v3 app with a very simple, custom auth provider. Things were working. I migrated to v4 (just created a new project and started porting code over). I scaffolded it from the refine install. It created a sample authProvider. But when I swapped in my revised custom auth provider, the app became unresponsive. Eventually traced it to useIsAuthenticated causes continuous rerendering of the component in which I call it. I reveted to the authprovider the refine seed project provided and modified its check method so that it always returns {authenticated: true}. Same thing, it just keeps rerending the component. If it returns {authenticated: false}, the app redirects to the login page.
Main question is whether this is a known issue? Any hints?
Was this page helpful?