Skip to content

Commit

Permalink
feat: 새로고침할때마다 토큰받아오도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pipisebastian committed Nov 19, 2024
1 parent 566ae0d commit 38d5ac4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
Expand Down

0 comments on commit 38d5ac4

Please sign in to comment.