Skip to content

Commit

Permalink
[Feat]라이브러리를 활용한 구글 로그인
Browse files Browse the repository at this point in the history
구글 로그인창으로 이동후 로그인
credentialResponse를 응답
백엔드로 전송후 디코딩, ID를 인증 후 엑세스 토큰과 리프레시 토큰을 프론트엔드로 전달
프론트엔드에서 토큰들을 로컬 스토리지에 저장
Issues #100
  • Loading branch information
김병현 authored and 김병현 committed Sep 13, 2023
1 parent b09a7e2 commit 62599d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/components/Logins/OAuthLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components';
import kakaoLogo from '../../asset/images/KakaoLogo.svg';
import axios from 'axios';
// import { GoogleOAuthProvider, GoogleLogin, googleLogout } from '@react-oauth/google';
import { GoogleOAuthProvider, GoogleLogin } from '@react-oauth/google';

const OAuthLoginModal: React.FC<LoginModalProps> = ({ onClose, onEmailLoginClick, onEmailSignupClick }) => {
const titleText = "로그인";
Expand Down Expand Up @@ -35,7 +35,7 @@ const OAuthLoginModal: React.FC<LoginModalProps> = ({ onClose, onEmailLoginClick
<ModalContainer>
<CloseButton onClick={onClose}>&times;</CloseButton>
<Title>{titleText}</Title>
{/* <GoogleOAuthProvider clientId="<your_client_id>">
<GoogleOAuthProvider clientId="690344785644-2oj84rcukd2rhu3o56gbq6rahap16m37.apps.googleusercontent.com">
<GoogleLogin
onSuccess={credentialResponse => {
console.log(credentialResponse);
Expand All @@ -44,7 +44,7 @@ const OAuthLoginModal: React.FC<LoginModalProps> = ({ onClose, onEmailLoginClick
console.log('Login Failed');
}}
/>;
</GoogleOAuthProvider>; */}
</GoogleOAuthProvider>;
<KakaoButton onClick={handleKakaoLogin}>
<LogoImage src={kakaoLogo} alt="Kakao Logo" />
{kakaoLoginText}
Expand Down

0 comments on commit 62599d2

Please sign in to comment.