diff --git a/src/app/layout.js b/src/app/layout.js index 2aa1a30a..3383aa10 100644 --- a/src/app/layout.js +++ b/src/app/layout.js @@ -51,13 +51,13 @@ export default async function RootLayout({ children }) { } } - // if (!headerPathname.includes('/login') && !session.isLoggedIn) { - // redirect('/login') - // } + if (!headerPathname.includes('/login') && !session.isLoggedIn) { + redirect('/login') + } - // if (headerPathname === '/login' && session.isLoggedIn) { - // redirect('/') - // } + if (headerPathname === '/login' && session.isLoggedIn) { + redirect('/') + } return ( diff --git a/src/components/auth/Login.jsx b/src/components/auth/Login.jsx index d53bd12d..98f7a5b6 100644 --- a/src/components/auth/Login.jsx +++ b/src/components/auth/Login.jsx @@ -98,7 +98,7 @@ export default function Login() { } else { Cookies.remove('chkLoginId') } - // router.push('/') + router.push('/') } else { alert(res.data.result.resultMsg) } @@ -107,8 +107,6 @@ export default function Login() { .catch((error) => { alert(error.response.data.message) }) - - router.push('/') } // 비밀번호 초기화 관련