diff --git a/frontend/src/api/api.ts b/frontend/src/api/api.ts index 88a4727da..127b28631 100644 --- a/frontend/src/api/api.ts +++ b/frontend/src/api/api.ts @@ -43,6 +43,8 @@ api.interceptors.response.use( (error: AxiosError) => { if (error?.response?.status === 401) { removeLocalStorageItem({ key: LOCAL_STORAGE_KEY.ACCESS_TOKEN }); + + history.push(PATH.LOGIN); } return Promise.reject(error); diff --git a/frontend/src/pages/GuestReservation/GuestReservation.tsx b/frontend/src/pages/GuestReservation/GuestReservation.tsx index 3a7134ac9..d654d8c75 100644 --- a/frontend/src/pages/GuestReservation/GuestReservation.tsx +++ b/frontend/src/pages/GuestReservation/GuestReservation.tsx @@ -65,7 +65,9 @@ const GuestReservation = (): JSX.Element => { const isEditMode = !!reservation; - const member = useMember(); + const member = useMember({ + enabled: !!accessToken, + }); const userName = member.data?.data.userName; const getReservations = useGuestReservations(