From 38d5ac4f7da7c46717962e73702c8577a67e8bb8 Mon Sep 17 00:00:00 2001 From: pipisebastian Date: Tue, 19 Nov 2024 18:16:06 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=83=88=EB=A1=9C=EA=B3=A0=EC=B9=A8?= =?UTF-8?q?=ED=95=A0=EB=95=8C=EB=A7=88=EB=8B=A4=20=ED=86=A0=ED=81=B0?= =?UTF-8?q?=EB=B0=9B=EC=95=84=EC=98=A4=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #140 --- client/src/App.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/src/App.tsx b/client/src/App.tsx index a5a43012..49764e40 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,7 +1,17 @@ +import { useEffect } from "react"; import { WorkSpace } from "@features/workSpace/WorkSpace"; +import { useRefreshMutation } from "./apis/auth"; +import { useUserInfo } from "./stores/useUserStore"; const App = () => { // TODO 라우터, react query 설정 + const { id } = useUserInfo(); + const { mutate: refreshToken } = useRefreshMutation(); + + useEffect(() => { + // 세션 스토리지에 정보가 있을 경우 토큰 갱신 + if (id) refreshToken(); + }, [id]); return ( <>