Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#189 accessToken도 세션스토리지에 저장 #190

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading