Skip to content

Commit

Permalink
Merge pull request #253 from Strong-Potato/206-feat-add-util-test
Browse files Browse the repository at this point in the history
Hotfix: fix kakao login
  • Loading branch information
NamgungJongMin authored Jan 28, 2024
2 parents 5e4d87b + 20aa995 commit 8defa84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
5 changes: 0 additions & 5 deletions src/api/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ export const authRequest = {
{withCredentials: true},
),

login_kakao: () =>
axios.get('https://api.tripvote.site/oauth2/authorization/kakao', {
withCredentials: true,
}),

logout: () => axios.post('/api/logout', {}, {withCredentials: true}),

/* --------------------------------- SIGNUP FLOW --------------------------------- */
Expand Down
25 changes: 7 additions & 18 deletions src/pages/Auth/Login/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import axios from 'axios';
import {Link, useNavigate} from 'react-router-dom';

import styles from './Login.module.scss';
Expand All @@ -7,7 +6,6 @@ import {useGetMyInfo} from '@/hooks/User/useUser';

import LoginForm from '@/components/Auth/Login/LoginForm';

import {authRequest} from '@/api/auth';
import KakaoIcon from '@/assets/kakao/kakao_path.svg?react';
import Logo from '@/assets/logo.svg?react';

Expand All @@ -22,17 +20,6 @@ function Login() {
navigate('/');
}

const onClickKakao = async () => {
try {
const res = await authRequest.login_kakao();
console.log('login_kakao response', res);
} catch (error) {
if (axios.isAxiosError(error)) {
console.log(error);
}
}
};

return (
<div className={styles.container}>
<h1 aria-hidden='true'>
Expand All @@ -54,11 +41,13 @@ function Login() {
<div className={styles.row_bar}></div>
</h2>

<button type='button' className={styles.snsLogin__btn} onClick={onClickKakao}>
<KakaoIcon />
<span className={styles.kakao_text}>카카오 로그인</span>
<span className={styles.kakao_space} aria-hidden></span>
</button>
<Link to='https://api.tripvote.site/oauth2/authorization/kakao'>
<button type='button' className={styles.snsLogin__btn}>
<KakaoIcon />
<span className={styles.kakao_text}>카카오 로그인</span>
<span className={styles.kakao_space} aria-hidden></span>
</button>
</Link>
</section>

<section className={styles.toHome}>
Expand Down

0 comments on commit 8defa84

Please sign in to comment.