From 39dcb3866419e4cde55166dc520c88538add0454 Mon Sep 17 00:00:00 2001 From: hyu-dev Date: Mon, 18 Dec 2023 16:50:06 +0900 Subject: [PATCH] =?UTF-8?q?fix.=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EA=B2=BD=EB=A1=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/templates/LoginTemplate/LoginBtn.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/templates/LoginTemplate/LoginBtn.tsx b/src/components/templates/LoginTemplate/LoginBtn.tsx index 83fe24f..47342e7 100644 --- a/src/components/templates/LoginTemplate/LoginBtn.tsx +++ b/src/components/templates/LoginTemplate/LoginBtn.tsx @@ -1,9 +1,9 @@ import { setAccessToken } from '@/store/reducers'; +import { authFetch } from '@api/axios'; import { TLoginResType } from '@api/types'; import { BtnKakaoLogin } from '@assets/images/BtnKakaoLogin'; import { Alert } from '@utils/Alert'; import { errors } from '@utils/errors'; -import axios from 'axios'; import { useDispatch } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import styled from 'styled-components'; @@ -15,7 +15,6 @@ type TProps = { export const LoginBtn = (props: TProps) => { const navigate = useNavigate(); const dispatch = useDispatch(); - const REACT_APP_SERVER_PATH: string | undefined = process.env.REACT_APP_SERVER_PATH; const REST_API_KEY: string | undefined = process.env.REACT_APP_KAKAO_API_KEY; const redirectUri: string = process.env.REACT_APP_REDIRECT_URL + '/login/auth'; const kakaoURL: string = `https://kauth.kakao.com/oauth/authorize?client_id=${REST_API_KEY}&redirect_uri=${redirectUri}&response_type=code`; @@ -26,7 +25,7 @@ export const LoginBtn = (props: TProps) => { const handleClickGuest = async () => { try { - const res = await axios.post(`${REACT_APP_SERVER_PATH}/api/user/login-guest`); + const res = await authFetch.post(`/api/user/login-guest`); if (res.status === 200) { const extractedToken = res.headers?.refreshtoken?.replace('Bearer ', ''); localStorage.setItem('rb-access-token', extractedToken);