Skip to content

Commit 3b22c25

Browse files
committed
feat: 코드리뷰 반영
1 parent 59ae588 commit 3b22c25

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

app/components/RequireAuth/RequireAuth.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ function RequireAuth({
4545
}
4646
}, []);
4747

48-
useEffect(() => {
49-
const checkToken = async () => {
50-
const result = await refreshToken();
51-
};
52-
53-
// checkToken();
54-
}, [refreshToken, router]);
55-
5648
useEffect(() => {
5749
if (categories.length > 0) {
5850
setCurrentTheme(categories.map(({ id, title }) => ({ id, title })));

app/utils/localStorage.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,11 @@ export const setSelectedThemeId = (themeId: number) => {
8383
// 필요하다면 한번에 가져오는 함수도 만들 수 있습니다
8484
export const getLoginInfo = (): LoginInfo => {
8585
return {
86-
accessToken: getLocalStorage(ACCESS_TOKEN) as string,
87-
refreshToken: getLocalStorage(REFRESH_TOKEN) as string,
88-
shopName: getLocalStorage(SHOP_NAME) as string,
89-
adminCode: getLocalStorage(ADMIN_CODE) as string,
90-
accessTokenExpiresIn: getLocalStorage(
91-
ACCESS_TOKEN_EXPIRES_IN
92-
) as unknown as number,
86+
accessToken: getLocalStorage(ACCESS_TOKEN) || "",
87+
refreshToken: getLocalStorage(REFRESH_TOKEN) || "",
88+
shopName: getLocalStorage(SHOP_NAME) || "",
89+
adminCode: getLocalStorage(ADMIN_CODE) || "",
90+
accessTokenExpiresIn: Number(getLocalStorage(ACCESS_TOKEN_EXPIRES_IN)) || 0,
9391
};
9492
};
9593
export const getStatus = () => getLocalStorage(STATUS);

0 commit comments

Comments
 (0)