Skip to content

Commit

Permalink
design: 마이 페이지 로그인 버튼 위치 수정 #256
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Mar 5, 2024
1 parent 1c5e2f2 commit 5f6ccaf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/hooks/withAuth.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { ComponentType, useEffect } from 'react';
import { toast } from 'react-toastify';

import { useRouter } from 'next/navigation';

Expand All @@ -18,8 +17,7 @@ function withAuth<Props = Record<string, never>>(

useEffect(() => {
if (userId == null) {
router.push('/');
toast.info('로그인 해주세요.');
router.replace('/login');
}
}, [userId, router]);

Expand Down

0 comments on commit 5f6ccaf

Please sign in to comment.