mirror of
https://github.com/ershisan99/todolist_next.git
synced 2026-01-21 21:02:05 +00:00
add delete and change status functionalities
This commit is contained in:
@@ -7,13 +7,10 @@ import { Loader } from "./loader";
|
||||
export const AuthRedirect: FC<{ children: ReactNode }> = ({ children }) => {
|
||||
const router = useRouter();
|
||||
const { data: user, isLoading, isError } = useMeQuery();
|
||||
console.log(user);
|
||||
const isAuthPage = router.pathname === "/login";
|
||||
|
||||
useEffect(() => {
|
||||
console.log("here");
|
||||
if (!isLoading && !user && !isAuthPage) {
|
||||
console.log("here");
|
||||
router.push("/login");
|
||||
}
|
||||
}, [user, isError, isLoading, isAuthPage, router]);
|
||||
|
||||
Reference in New Issue
Block a user