switch to bun + biomejs

fix infinite load on failed token refresh
This commit is contained in:
2024-08-09 16:15:50 +02:00
parent 53984d9c89
commit 750578b787
9 changed files with 34 additions and 3614 deletions

View File

@@ -9,14 +9,14 @@ import { useMeQuery } from "@/services";
export const AuthRedirect: FC<{ children: ReactNode }> = ({ children }) => {
const router = useRouter();
const { data: user, isLoading, isError } = useMeQuery();
const { data: user, isLoading } = useMeQuery();
const isAuthPage = router.pathname === "/login";
useEffect(() => {
if (!isLoading && !user && !isAuthPage) {
router.push("/login");
}
}, [user, isError, isLoading, isAuthPage, router]);
}, [user, isLoading, isAuthPage, router]);
if (isLoading || (!user && !isAuthPage)) {
return (