Skip to content

Commit

Permalink
Merge pull request #96 from Next-Room/fix/change-routing-logout
Browse files Browse the repository at this point in the history
fix: 401 에러시 바로 로그아웃 처리되지 않는 이슈 수정
  • Loading branch information
lgrin-byte authored Feb 5, 2025
2 parents 8b9fe70 + fe01ac5 commit 3c4509b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/lib/reactQueryProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { PropsWithChildren, useState } from "react";
import axios from "axios";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { useRouter } from "next/navigation";

import {
getLoginInfo,
Expand Down Expand Up @@ -94,8 +93,7 @@ apiClient.interceptors.response.use(
processQueue(refreshError, null);
removeLocalStorageAll();
if (typeof window !== "undefined") {
const router = useRouter();
router.push("/login");
window.location.href = "/login";
}
throw refreshError;
} finally {
Expand Down

0 comments on commit 3c4509b

Please sign in to comment.