Skip to content

Commit

Permalink
Merge pull request #10 from Read-bird/feature/yj
Browse files Browse the repository at this point in the history
fix. 로그인 버튼 경로 오류 수정
  • Loading branch information
devwoodie authored Dec 18, 2023
2 parents 4be0bf5 + 39dcb38 commit 5d5d75d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/templates/LoginTemplate/LoginBtn.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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`;
Expand All @@ -26,7 +25,7 @@ export const LoginBtn = (props: TProps) => {

const handleClickGuest = async () => {
try {
const res = await axios.post<TLoginResType>(`${REACT_APP_SERVER_PATH}/api/user/login-guest`);
const res = await authFetch.post<TLoginResType>(`/api/user/login-guest`);
if (res.status === 200) {
const extractedToken = res.headers?.refreshtoken?.replace('Bearer ', '');
localStorage.setItem('rb-access-token', extractedToken);
Expand Down

0 comments on commit 5d5d75d

Please sign in to comment.