구글로그인
-
react-google-login 을 통해서 구글 로그인 구현하기REACT 2021. 11. 6. 12:21
node js를 통해서 oauth2를 구현하는 방법도 있지만, 라이브러리를 통해서 react(프론트엔드)단에서 바로 구글 로그일을 구현하는 방법도 있다. React Google Login 라이브러리 설치 npm install react-google-login 먼저 해당 라이브러리를 설치해준다. 사용하기 import React from 'react'; import ReactDOM from 'react-dom'; import GoogleLogin from 'react-google-login'; // or import { GoogleLogin } from 'react-google-login'; //로그인 성공했을 떄 처리 함수 const successGoogle = (response) => { console...
-
idpiframe initialization failed 에러 발생 시.etc 2021. 11. 6. 12:12
구글 로그인 연동을 시도하던 중 idpiframe initialization failed가 발생하였다. 구글로그인을 시도하는 데 third party cookies enabled 설정이 이미 완료된 상태일 때 발생한다. 구글 크롬 설정 -> 고급 -> 개인정보 및 보안 -> 인터넷 사용 기록 삭제 -> 모든 쿠키와 캐시된 이미지 또는 파일 삭제를 통해서 해겨랗ㄹ 수 있다. (참고한 사이트) https://stackoverflow.com/questions/43964539/google-api-not-a-valid-origin-for-the-client-url-has-not-been-whitelisted-for Google API: Not a valid origin for the client: url has ..