Skip to content

Commit addb77e

Browse files
authored
Merge pull request Next-Room#90 from Next-Room/feat/add-refresh-token
feat: 리프레쉬 토큰 갱신 및 로그인 정보 로컬스토리지 -> 세션스토리지 이동
2 parents dbf6319 + 67b6e2d commit addb77e

File tree

22 files changed

+137
-187
lines changed

22 files changed

+137
-187
lines changed

app/admin/(components)/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
getStatus,
1616
removeAccessToken,
1717
removeThemeId,
18-
} from "@/utils/localStorage";
18+
} from "@/utils/storageUtil";
1919
import { useSelectedThemeReset } from "@/components/atoms/selectedTheme.atom";
2020
import { useIsLoggedInWrite } from "@/components/atoms/account.atom";
2121
import { useDrawerState } from "@/components/atoms/drawer.atom";

app/admin/(components)/ThemeDrawer/hooks/useImages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { useCreateHint } from "@/components/atoms/createHint.atom";
1212
import { useSelectedHint } from "@/components/atoms/selectedHint.atom";
1313
import { useToastWrite } from "@/components/atoms/toast.atom";
14-
import { getStatus } from "@/utils/localStorage";
14+
import { getStatus } from "@/utils/storageUtil";
1515
import { subscribeLinkURL } from "@/admin/(consts)/sidebar";
1616

1717
import { compressImage, convertToPng } from "../helpers/imageHelpers";

app/admin/Admin.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useRouter } from "next/navigation";
55

66
import useCheckSignIn from "@/hooks/useCheckSignIn";
77
import Loader from "@/components/Loader/Loader";
8-
import { getLoginInfo, setSelectedThemeId } from "@/utils/localStorage";
8+
import { getLoginInfo, setSelectedThemeId } from "@/utils/storageUtil";
99
import { useSelectedTheme } from "@/components/atoms/selectedTheme.atom";
1010
import { useGetThemeList } from "@/queries/getThemeList";
1111
import { useToastInfo } from "@/components/atoms/toast.atom";

app/components/RequireAuth/RequireAuth.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@
33
import React, { ReactNode, useEffect, useMemo, useState } from "react";
44
import { useRouter, usePathname } from "next/navigation";
55

6-
import { useTokenRefresh } from "@/mutations/useRefresh";
76
import { useGetThemeList } from "@/queries/getThemeList";
87
import {
98
useCurrentTheme,
109
useCurrentThemeReset,
1110
} from "@/components/atoms/currentTheme.atom";
1211
import { useSelectedThemeReset } from "@/components/atoms/selectedTheme.atom";
1312
import { useIsLoggedIn } from "@/components/atoms/account.atom";
14-
import { getSelectedThemeId } from "@/utils/localStorage";
13+
14+
import { getSelectedThemeId } from "@/utils/storageUtil";
15+
import * as S from "@/home/HomeView.styled";
16+
import Header from "@/components/common/Header/Header";
17+
import MainDrawer from "@/components/common/Drawer/Drawer";
1518

1619
import Mobile from "../Mobile/Mobile";
1720

@@ -29,7 +32,7 @@ function RequireAuth({ children }: RequireAuthProps) {
2932
const [isMobile, setIsMobile] = useState(false);
3033
const [isLoading, setIsLoading] = useState(true);
3134
const { data: categories = [] } = useGetThemeList();
32-
const { refreshToken, error } = useTokenRefresh();
35+
3336
useEffect(() => {
3437
if (typeof window !== "undefined") {
3538
const { userAgent } = window.navigator;

app/components/common/Dialog-new/Dialog.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,4 @@ const Dialog = forwardRef<HTMLFormElement, DialogProps>((props) => {
124124
);
125125
});
126126

127-
Dialog.defaultProps = {
128-
type: "",
129-
};
130-
131127
export default Dialog;

app/components/common/Drawer/Drawer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
useSelectedTheme,
1919
} from "@/components/atoms/selectedTheme.atom";
2020
import { Theme, Themes } from "@/queries/getThemeList";
21-
import { getLoginInfo } from "@/utils/localStorage";
21+
import { getLoginInfo } from "@/utils/storageUtil";
2222
import Dialog from "@/components/common/Dialog/Dialog";
2323

2424
import * as S from "./DrawerView.styled";

app/components/common/EmptyHome/EmptyHomeView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useRouter } from "next/navigation";
44

55
import { HOME_TITLE } from "@/consts/components/home";
66
import { useModalStateWrite } from "@/components/atoms/modalState.atom";
7-
import { getLoginInfo } from "@/utils/localStorage";
7+
import { getLoginInfo } from "@/utils/storageUtil";
88

99
import * as S from "./EmptyHomeView.styled";
1010

app/components/common/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState, MouseEvent } from "react";
22

33
import { useIsLoggedInWrite } from "@/components/atoms/account.atom";
4-
import { removeAccessToken } from "@/utils/localStorage";
4+
import { removeAccessToken } from "@/utils/storageUtil";
55

66
import HeaderView from "./HeaderView";
77

app/components/common/Hint-Dialog-new/Dialog.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,4 @@ const Dialog = forwardRef<HTMLFormElement, DialogProps>((props) => {
9191
);
9292
});
9393

94-
Dialog.defaultProps = {
95-
type: "",
96-
};
97-
9894
export default Dialog;

app/hooks/useCheckSignIn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useEffect } from "react";
22

33
import { apiClient } from "@/lib/reactQueryProvider";
4-
import { getLoginInfo } from "@/utils/localStorage";
4+
import { getLoginInfo } from "@/utils/storageUtil";
55
import { useIsLoggedIn } from "@/components/atoms/account.atom";
66
import { getSubscriptionPlan } from "@/queries/getSubscriptionPlan";
77

0 commit comments

Comments
 (0)