// 인증 엔드포인트 호출 함수 (순수 HTTP 레이어, React 의존 없음). // refresh_token 재발급은 http.ts 인터셉터가 자동 처리하므로 여기서 노출하지 않는다. import { http } from '@/apis/http' import type { CreateAccountRequest, CreateAccountResponse, HidePopupRequest, HidePopupResponse, LoginRequest, LoginResponse, LogoutResponse, MeResponse, PopupStatusResponse, SessionBrandingResponse, } from './auth.type' export const authApi = { /** POST /v1/auth/login — ID/PW 로 로그인, access/refresh 토큰 발급 */ login: async (body: LoginRequest): Promise => { const res = await http.post('/v1/auth/login', body) return res.data }, /** POST /v1/auth/create — 신규 공급사 유저 계정 생성 */ createAccount: async (body: CreateAccountRequest): Promise => { const res = await http.post('/v1/auth/create', body) return res.data }, /** GET /v1/auth/session-branding/{sessionId} — 로그인 전 화면용 브랜딩(인증 불필요) */ sessionBranding: async (sessionId: string): Promise => { const res = await http.get(`/v1/auth/session-branding/${sessionId}`) return res.data }, /** GET /v1/auth/me — 현재 로그인 유저 정보 (access token 필요) */ me: async (): Promise => { const res = await http.get('/v1/auth/me') return res.data }, /** POST /v1/auth/logout — 서버측 토큰 폐기(단일 세션) */ logout: async (): Promise => { const res = await http.post('/v1/auth/logout') return res.data }, /** GET /v1/auth/popup/status — 유저별 팝업 '안내 보지 않기' 저장 상태 */ popupStatus: async (): Promise => { const res = await http.get('/v1/auth/popup/status') return res.data }, /** POST /v1/auth/popup/hide — 해당 팝업을 다시 표시하지 않도록 영구 저장 */ hidePopup: async (body: HidePopupRequest): Promise => { const res = await http.post('/v1/auth/popup/hide', body) return res.data }, }