AuthStatus.tsx 315 B

123456789101112131415161718
  1. 'use client';
  2. import { useRouter } from 'next/navigation';
  3. import useAuth from "@/hooks/useAuth";
  4. export default function AuthStatus()
  5. {
  6. const router = useRouter();
  7. const { isAuthenticated } = useAuth();
  8. if (isAuthenticated) {
  9. return router.push('/');
  10. }
  11. return (
  12. <></>
  13. );
  14. }