diff --git a/assets/api-docs.yaml b/assets/api-docs.yaml index 236f459..b77ae83 100644 --- a/assets/api-docs.yaml +++ b/assets/api-docs.yaml @@ -138,6 +138,12 @@ paths: tags: - auth-controller operationId: refreshToken + parameters: + - name: refreshToken + in: cookie + required: true + schema: + type: string requestBody: content: application/json: @@ -150,7 +156,7 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/UserTokenDto' + $ref: '#/components/schemas/AccessTokenResponse' /api/v1/auth/logout: post: tags: @@ -274,7 +280,7 @@ paths: content: '*/*': schema: - $ref: '#/components/schemas/UserTokenDto' + $ref: '#/components/schemas/AccessTokenResponse' /api/v1/auth/info: get: tags: @@ -965,23 +971,17 @@ components: RefreshTokenRequest: required: - accessToken - - refreshToken type: object properties: accessToken: type: string - refreshToken: - type: string - UserTokenDto: + AccessTokenResponse: required: - accessToken - - refreshToken type: object properties: accessToken: type: string - refreshToken: - type: string InfoToShareIdealPartner: type: object properties: diff --git a/src/app/routes/auth.kakao.tsx b/src/app/routes/auth.kakao.tsx index f4668d8..d793ec2 100644 --- a/src/app/routes/auth.kakao.tsx +++ b/src/app/routes/auth.kakao.tsx @@ -27,7 +27,7 @@ export default function KakaoAuthPage() { const response = await loginKakao({ code, }); - const token = response.data.accessToken; + const token = response.accessToken; useAuthStore.getState().login(token); location.href = '/'; } catch (e) { diff --git a/src/types.ts b/src/types.ts index e201760..7822993 100644 --- a/src/types.ts +++ b/src/types.ts @@ -411,14 +411,12 @@ export interface InfoToShareResponse { userInfo: InfoToShareUserInfo; } -export interface UserTokenDto { +export interface AccessTokenResponse { accessToken: string; - refreshToken: string; } export interface RefreshTokenRequest { accessToken: string; - refreshToken: string; } export interface ImageDto { @@ -1035,7 +1033,7 @@ formData.append('image', uploadImageBody.image) export const refreshToken = ( refreshTokenRequest: RefreshTokenRequest, options?: SecondParameter,) => { - return customInstance( + return customInstance( {url: `/api/v1/auth/refresh-token`, method: 'POST', headers: {'Content-Type': 'application/json', }, data: refreshTokenRequest @@ -1109,7 +1107,7 @@ export const getAddress = ( export const loginKakao = ( params: LoginKakaoParams, options?: SecondParameter,) => { - return customInstance( + return customInstance( {url: `/api/v1/auth/kakao/login`, method: 'GET', params },