Skip to content

Commit

Permalink
Merge pull request #55 from LikeLionHGU/#43/ConnectSignInAPI-최예라
Browse files Browse the repository at this point in the history
feat: 로그인 모달 카카오 버튼 클릭시 redirect url로 이동 (로그인 구현은 아직 안 됨)
  • Loading branch information
YearaChoi authored Aug 3, 2024
2 parents fd584ec + 0c09c78 commit d4b6169
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/MainPage/LoginModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ import googleLoginBtn from "../../assets/img/googleLoginBtn.svg";
import kakaoLoginBtn from "../../assets/img/kakaoLoginBtn.svg";

function LoginModal({ toggleModal }) {
const handleKakaoLogin = () => {
const REST_API_KEY = process.env.REACT_APP_KAKAO_AUTH_CLIENT_ID;
const REDIRECT_URI = process.env.REACT_APP_KAKAO_AUTH_REDIRECT_URL;

window.location.href = `https://kauth.kakao.com/oauth/authorize?client_id=${REST_API_KEY}&redirect_uri=${REDIRECT_URI}&response_type=code`;
};

return (
<Modal>
<Overlay onClick={toggleModal} />
Expand All @@ -24,6 +31,7 @@ function LoginModal({ toggleModal }) {
alt="구글 로그인 버튼"
></GoogleLoginBtn>
<KakaoLoginBtn
onClick={handleKakaoLogin}
src={kakaoLoginBtn}
alt="카카오 로그인 버튼"
></KakaoLoginBtn>
Expand Down

0 comments on commit d4b6169

Please sign in to comment.