From deb590ceee83bd854cd0825b53c0f62c412a4e9e Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Sun, 16 Aug 2020 17:02:12 -0300 Subject: [PATCH] Places Google Login button inside login widget --- .../main-home/main-home-page-login-widget.js | 20 +++++++++++++++++-- client/src/index.html | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/client/src/app/main/main-home/main-home-page-login-widget.js b/client/src/app/main/main-home/main-home-page-login-widget.js index 3e5fd685..47460c2b 100644 --- a/client/src/app/main/main-home/main-home-page-login-widget.js +++ b/client/src/app/main/main-home/main-home-page-login-widget.js @@ -1,12 +1,10 @@ import React from 'react'; -import ReactDOM from 'react-dom'; import {connect} from 'react-redux'; import classNames from 'classnames'; import _ from 'lodash'; import SessionActions from 'actions/session-actions'; import API from 'lib-app/api-call'; -import focus from 'lib-core/focus'; import i18n from 'lib-app/i18n'; import PasswordRecovery from 'app-components/password-recovery'; @@ -45,9 +43,27 @@ class MainHomePageLoginWidget extends React.Component { } renderLogin() { + const defaultGoogleHandler = (response) => { + console.log(response); + } + + gapi.load('auth2', () => { + gapi.auth2.init({client_id: '50174278643-gtvjdpm5rmkv75lf3jsp95iv77a2usgu.apps.googleusercontent.com'}) + gapi.signin2.render('google-oauth-id', { + scope: 'email', + width: 200, + height: 30, + longtitle: true, + theme: 'dark', + onsuccess: defaultGoogleHandler, + onfailure: defaultGoogleHandler + }) + }) + return (
+
Loading Google Login ...
diff --git a/client/src/index.html b/client/src/index.html index 10403723..986cb3df 100755 --- a/client/src/index.html +++ b/client/src/index.html @@ -16,6 +16,7 @@ +