File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed
Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change 11import { SignInRequest , SignInResponse , SignUpRequest } from '@/types/auth.types'
2- import axios , { AxiosResponse } from 'axios'
32
4- const BASE_URL = process . env . NEXT_PUBLIC_API_BASE_URL
5-
6- if ( ! BASE_URL ) {
7- throw new Error ( "νκ²½ λ³μ 'NEXT_PUBLIC_API_BASE_URL'μ΄ μ μλμ§ μμμ΅λλ€." )
8- }
9-
10- // Axios μΈμ€ν΄μ€ μμ±
11- const apiClient = axios . create ( {
12- baseURL : BASE_URL ,
13- // withCredentials: true,
14- } )
15-
16- export const signIn = async (
17- data : SignInRequest
18- ) : Promise < AxiosResponse < SignInResponse > > => {
19- return await apiClient . post < SignInResponse > ( '/v1/auth/sign-in' , data , {
20- // withCredentials: true, //
21- } )
22- }
23-
24- export const signOut = async ( ) => {
25- return await axios . post ( '/v1/auth/logout' , { } , { withCredentials : true } )
26- }
27-
283const BACKEND_BASE_URL = process . env . NEXT_PUBLIC_BACKEND_BASE_URL
294export const SignUp = async ( data : SignUpRequest ) : Promise < Response > => {
305 return await fetch ( `${ BACKEND_BASE_URL } /v1/auth/sign-up` , {
You canβt perform that action at this time.
0 commit comments