From 5bacfb04b5d65493dbbc31be1edcfc5882ece1ff Mon Sep 17 00:00:00 2001 From: bicochan Date: Wed, 8 Jul 2026 15:57:17 +0900 Subject: [PATCH] =?UTF-8?q?[st]=20chore:=20auth=20=EC=84=9C=EB=B9=84?= =?UTF-8?q?=EC=8A=A4=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../st/app/(main)/(with-base-layout)/layout.tsx | 4 ++-- apps/st/src/entities/auth/api/auth-service.ts | 9 +++++++-- apps/st/src/entities/auth/lib/token-manager.ts | 17 +++++++++-------- .../src/entities/auth/model/auth-interface.ts | 10 ---------- apps/st/tsconfig.json | 3 +-- 5 files changed, 19 insertions(+), 24 deletions(-) delete mode 100644 apps/st/src/entities/auth/model/auth-interface.ts diff --git a/apps/st/app/(main)/(with-base-layout)/layout.tsx b/apps/st/app/(main)/(with-base-layout)/layout.tsx index 287cc4c38..16baba982 100644 --- a/apps/st/app/(main)/(with-base-layout)/layout.tsx +++ b/apps/st/app/(main)/(with-base-layout)/layout.tsx @@ -19,7 +19,7 @@ import { import { useStatisticsTabUrlSync } from "@/shared/lib/use-statistics-tab-url-sync"; import { isVerificationSelectionReportMenu } from "@/shared/lib/verification-selection-report"; import { StatisticsPageLayout } from "@/shared/ui/statistics-page-layout"; -import { tokenManager } from "@/entities/auth"; +import { authService } from "@/entities/auth"; import type { MenuItem } from "@/entities/menu"; import { MenuApi } from "@/entities/menu"; import { BaseLayout } from "@common/components"; @@ -243,7 +243,7 @@ function WithBaseLayoutInner({ children }: { children: React.ReactNode }) { return ( diff --git a/apps/st/src/entities/auth/api/auth-service.ts b/apps/st/src/entities/auth/api/auth-service.ts index 0bef2fee3..ea77f8a36 100644 --- a/apps/st/src/entities/auth/api/auth-service.ts +++ b/apps/st/src/entities/auth/api/auth-service.ts @@ -5,14 +5,18 @@ import { ENDPOINT, } from "@/shared/config"; import { getCookie } from "@/shared/lib"; -import { getRemainingMs } from "@common/auth"; +import { + type AuthPayload, + type AuthService, + getRemainingMs, +} from "@common/auth"; import { clearAuthToken, + clearRefreshTimer, setToken, setupRefreshTimer, } from "../lib/token-manager"; -import type { AuthPayload, AuthService } from "../model/auth-interface"; import { clearTabStorePersist } from "@/store/tab-store"; @@ -96,5 +100,6 @@ export async function logout(): Promise { export const authService: AuthService = { login, silentRefresh, + declineSessionExtend: clearRefreshTimer, logout, }; diff --git a/apps/st/src/entities/auth/lib/token-manager.ts b/apps/st/src/entities/auth/lib/token-manager.ts index d449e711b..85574f244 100644 --- a/apps/st/src/entities/auth/lib/token-manager.ts +++ b/apps/st/src/entities/auth/lib/token-manager.ts @@ -4,12 +4,13 @@ import { createTokenManager } from "@common/auth"; export const tokenManager = createTokenManager(authConfig); export const { - getToken, - setToken, - removeToken, - setupRefreshTimer, - clearAuthToken, - getAccessToken, - getRefreshToken, - getUserId, + getToken, + setToken, + removeToken, + setupRefreshTimer, + clearRefreshTimer, + clearAuthToken, + getAccessToken, + getRefreshToken, + getUserId, } = tokenManager; diff --git a/apps/st/src/entities/auth/model/auth-interface.ts b/apps/st/src/entities/auth/model/auth-interface.ts deleted file mode 100644 index 9f76aaf35..000000000 --- a/apps/st/src/entities/auth/model/auth-interface.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface AuthPayload { - userId: string; - password: string; -} - -export interface AuthService { - login(payload: AuthPayload): Promise; - silentRefresh(): Promise; - logout(): Promise; -} diff --git a/apps/st/tsconfig.json b/apps/st/tsconfig.json index 7e8241dc4..d5062feda 100644 --- a/apps/st/tsconfig.json +++ b/apps/st/tsconfig.json @@ -22,9 +22,8 @@ "name": "next" } ], - "baseUrl": "./src", "paths": { - "@/*": ["./*"] + "@/*": ["./src/*"] } }, "include": [