Skip to content

Commit

Permalink
Merge pull request #190 from boostcampwm-2024/Feature/#189_access_tok…
Browse files Browse the repository at this point in the history
…en도_세션스토리지에_저장

Feature/#189 accessToken도 세션스토리지에 저장
  • Loading branch information
github-actions[bot] authored Nov 25, 2024
2 parents 8e2f567 + 059d17e commit 8a17ce5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
10 changes: 0 additions & 10 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
import { useRefreshQuery } from "@apis/auth";
import { useErrorStore } from "@stores/useErrorStore";
import { useUserInfo } from "@stores/useUserStore";
import { useEffect } from "react";
import { ErrorModal } from "@components/modal/ErrorModal";
import { WorkSpace } from "@features/workSpace/WorkSpace";
import { useSocketStore } from "./stores/useSocketStore";

const App = () => {
// TODO 라우터, react query 설정
const { id, name, accessToken } = useUserInfo();
const { refetch: refreshToken } = useRefreshQuery();
const { isErrorModalOpen, errorMessage } = useErrorStore();

useEffect(() => {
if (id && name && !accessToken) {
refreshToken();
}
}, []);

useEffect(() => {
const socketStore = useSocketStore.getState();
socketStore.init();
Expand Down
1 change: 1 addition & 0 deletions client/src/stores/useUserStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const useUserStore = create<UserStore>()(
partialize: (state) => ({
id: state.id,
name: state.name,
accessToken: state.accessToken,
}),
},
),
Expand Down

0 comments on commit 8a17ce5

Please sign in to comment.