diff --git a/src/hooks/useLoggedOut.ts b/src/hooks/useLoggedOut.ts index ddc83f6a..e28a0d83 100644 --- a/src/hooks/useLoggedOut.ts +++ b/src/hooks/useLoggedOut.ts @@ -1,17 +1,14 @@ -import { useCookies } from 'react-cookie'; - import { useQueryClient } from '@tanstack/react-query'; import { useRouter } from 'next/navigation'; import { useAppDispatch } from '@stores/hooks'; import { clearUserId } from '@stores/slices/userSlice'; +import { removeCookie } from '@utils/cookies'; function useLoggedOut() { const router = useRouter(); const dispatch = useAppDispatch(); const query = useQueryClient(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [cookies, removeCookie] = useCookies(['token']); const logout = (redirectPath = '/') => { dispatch(clearUserId()); diff --git a/src/remote/queries/auth/useLogin.ts b/src/remote/queries/auth/useLogin.ts index 60079703..12d9fd1f 100644 --- a/src/remote/queries/auth/useLogin.ts +++ b/src/remote/queries/auth/useLogin.ts @@ -1,5 +1,3 @@ -import { useCookies } from 'react-cookie'; - import { useMutation } from '@tanstack/react-query'; import { useRouter } from 'next/navigation'; @@ -7,14 +5,13 @@ import { login } from '@remote/api/requests/auth/auth.post.api'; import { UserInfoType } from '@remote/api/types/auth'; import { useAppDispatch } from '@stores/hooks'; import { setUserId } from '@stores/slices/userSlice'; +import { setCookie } from '@utils/cookies'; function useLogin() { const router = useRouter(); const dispatch = useAppDispatch(); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [cookies, setCookie] = useCookies(['token']); - const onSuccess = (data : UserInfoType) => { + const onSuccess = (data: UserInfoType) => { const { id, jwtToken } = data.value; const cookieOptions = { path: '/', maxAge: 60 * 15 };