diff --git a/app/components/Catcher.tsx b/app/components/Catcher.tsx index 3e0a946be..4c243af44 100644 --- a/app/components/Catcher.tsx +++ b/app/components/Catcher.tsx @@ -24,9 +24,12 @@ export function Catcher() { const location = useLocation(); // refresh user data to make sure it's up to date (e.g. cookie might have been removed, let's show the prompt to log back in) + const hasRevalidated = React.useRef(false); React.useEffect(() => { if (!isRouteErrorResponse(error) || error.status !== 401) return; + if (hasRevalidated.current) return; + hasRevalidated.current = true; revalidate(); }, [revalidate, error]);