-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
84 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,29 @@ | ||
import { authAxios } from '@services/axiosProvider'; | ||
import type { User, UserSignInForm } from '@/types/UserType'; | ||
import { defaultAxios } from '@services/axiosProvider'; | ||
|
||
import type { AxiosRequestConfig } from 'axios'; | ||
import type { UserSignInForm } from '@/types/UserType'; | ||
|
||
/** | ||
* 사용자 로그인 API | ||
* | ||
* @export | ||
* @async | ||
* @param {UserSignInForm} loginForm - 로그인 폼 데이터 | ||
* @returns {Promise<AxiosResponse<User>>} | ||
* @param {AxiosRequestConfig} [axiosConfig={}] - axios 요청 옵션 설정 객체 | ||
* @returns {Promise<AxiosResponse>} | ||
*/ | ||
export async function login(loginForm: UserSignInForm, axiosConfig: AxiosRequestConfig = {}) { | ||
return defaultAxios.post('user/login', loginForm, { ...axiosConfig, withCredentials: true }); | ||
} | ||
|
||
/** | ||
* 사용자 액세스 토큰 갱신 API | ||
* | ||
* @export | ||
* @async | ||
* @param {AxiosRequestConfig} [axiosConfig={}] - axios 요청 옵션 설정 객체 | ||
* @returns {Promise<AxiosResponse>} | ||
*/ | ||
export async function login(loginForm: UserSignInForm) { | ||
return authAxios.post<User>('user/login', loginForm, { withCredentials: true }); | ||
export async function getAccessToken(axiosConfig: AxiosRequestConfig = {}) { | ||
return defaultAxios.post('user/login/refresh', null, { ...axiosConfig, withCredentials: true }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters