[as] chore: auth 서비스 수정

This commit is contained in:
2026-07-08 15:55:54 +09:00
parent e05c2a03e0
commit b6714dd8a4
4 changed files with 19 additions and 7 deletions
+2 -2
View File
@@ -5,11 +5,11 @@ import { usePathname, useRouter } from "next/navigation";
import { useQueryClient } from "@tanstack/react-query";
import { useMenuStore } from "@/shared/lib";
import { PageLayout } from "@/shared/ui/page-layout";
import { authService } from "@/entities/auth";
import type { MenuItem } from "@/entities/menu";
import { BaseLayout } from "@common/components";
import { useMenuStore } from "@/shared/lib";
import { PageLayout } from "@/shared/ui/page-layout";
interface BaseLayoutWrapperProps {
children: React.ReactNode;
+16 -4
View File
@@ -1,8 +1,19 @@
import { ACCESS_TOKEN, AUTH_LOGIN_REDIRECT_URL, AUTH_USER_ID, CLAIM_NAME, ENDPOINT } from "@/shared/config";
import { getRemainingMs } from "@common/auth";
import {
ACCESS_TOKEN,
AUTH_LOGIN_REDIRECT_URL,
AUTH_USER_ID,
CLAIM_NAME,
ENDPOINT,
} from "@/shared/config";
import { type AuthPayload, type AuthService, getRemainingMs } from "@common/auth";
import { clearAuthToken, removeToken, setToken, setupRefreshTimer } from "../lib/token-manager";
import type { AuthPayload, AuthService } from "../model/auth-interface";
import {
clearAuthToken,
clearRefreshTimer,
removeToken,
setToken,
setupRefreshTimer,
} from "../lib/token-manager";
async function login(payload: AuthPayload): Promise<void> {
const response = await fetch(`/api/proxy${ENDPOINT.USER_SERVICE.LOGIN}`, {
@@ -88,5 +99,6 @@ async function logout(): Promise<void> {
export const authService: AuthService = {
login,
silentRefresh,
declineSessionExtend: clearRefreshTimer,
logout,
};
@@ -8,6 +8,7 @@ export const {
setToken,
removeToken,
setupRefreshTimer,
clearRefreshTimer,
clearAuthToken,
getAccessToken,
getRefreshToken,
@@ -1 +0,0 @@
export type { AuthPayload, AuthService } from "@common/auth";