diff --git a/src/app/(sidebar)/layout.tsx b/src/app/(sidebar)/layout.tsx index cb4a2a7..12bcdeb 100644 --- a/src/app/(sidebar)/layout.tsx +++ b/src/app/(sidebar)/layout.tsx @@ -8,15 +8,15 @@ import { NotificatinProvider } from '@/components/Notification/context'; export default function SidebarLayout({ children }: PropsWithChildren) { return (
- - -
- + + + +
{children} - -
-
+
+
+
); } diff --git a/src/app/AuthRedirect.tsx b/src/app/AuthRedirect.tsx index a441fbd..15932ca 100644 --- a/src/app/AuthRedirect.tsx +++ b/src/app/AuthRedirect.tsx @@ -1,5 +1,5 @@ import { cookies } from 'next/headers'; -import { ACCESS_TOKEN, JOB_SELECTION } from './login/constants/token'; +import { ACCESS_TOKEN, JOB_SELECTION, REFRESH_TOKEN } from './login/constants/token'; import { redirect } from 'next/navigation'; import type { StrictPropsWithChildren } from '@/types'; @@ -7,8 +7,9 @@ export default async function AuthRedirect({ children }: StrictPropsWithChildren const accessToken = cookies().get(ACCESS_TOKEN)?.value; const isJobSelection = cookies().get(JOB_SELECTION)?.value; - if (accessToken == null || isJobSelection == null) { + if (!accessToken || !isJobSelection) { cookies().delete(ACCESS_TOKEN); + cookies().delete(REFRESH_TOKEN); cookies().delete(JOB_SELECTION); redirect('/login'); } diff --git a/src/container/Sidebar/Sidebar.tsx b/src/container/Sidebar/Sidebar.tsx index dc459a0..546c244 100644 --- a/src/container/Sidebar/Sidebar.tsx +++ b/src/container/Sidebar/Sidebar.tsx @@ -34,6 +34,7 @@ export function Sidebar() { const logout = () => { deleteCookie('accessToken'); deleteCookie('refreshToken'); + deleteCookie('jobSelection'); router.push('/login'); };