diff --git a/src/Components/LoginContainerFunction.js b/src/Components/LoginContainerFunction.js index c4c38394fde12ae661c3d5699d573f66b70425d2..6d87b92708989d3976d91d72e4b0f921760e1fea 100644 --- a/src/Components/LoginContainerFunction.js +++ b/src/Components/LoginContainerFunction.js @@ -27,6 +27,16 @@ import FormInput from "./FormInput.js" import GoogleLogo from "../img/logo_google.svg" import ValidateUserInput from '../Components/FormValidationFunction.js' import {Link} from 'react-router-dom' +import {apiUrl} from '../env.js' + +async function handleGoogleAttempt () { + console.log("handleGoogleAttempt") + let request_url = ( + `${apiUrl}/omniauth/google_oauth2?auth_origin_url=` + window.location.href + '&omniauth_window_type=sameWindow&resource_class=User' + ) + window.location.replace(request_url) +} + export default function LoginContainer (props) { const [formEmail, setEmail] = useState( @@ -94,11 +104,6 @@ export default function LoginContainer (props) { } - //arrumar isso - const handleGoogleResponse = (response) => { - console.log(response); - } - return ( <div> <ContainerStyled > @@ -113,14 +118,10 @@ export default function LoginContainer (props) { <DialogContentDiv> <SocialConnectDiv> - {/*<StyledGoogleLoginButton - clientId="288460085642-k4veg4fo8kddvjer8b055n9da5qtgha7.apps.googleusercontent.com" - onSuccess={ } - onFailure={ } - cookiePolicy={'single_host_origin'} - > - <span style={{textTransform:"none", fontSize:"13px", color : "#666"}}>Usando o Google</span> - </StyledGoogleLoginButton>*/} + <GoogleLoginButton onClick={handleGoogleAttempt}> + <img src={GoogleLogo} alt="google-logo" className="google-logo"/> + <span>Usando o Google</span> + </GoogleLoginButton> </SocialConnectDiv> <H3Div> @@ -346,3 +347,21 @@ export const RightSideStrikedH3 = styled.div` font-weight : 400; padding-top : 2px; ` +export const GoogleLoginButton = styled(Button)` + background-color : #fff; + box-shadow : 0 0 0 1px #4285f4 !important; + color : #666 !important; + font-weight : bolder !important; + + .MuiButton-root { + min-width : 88px !important; + font-size : 14px !important; + } + + .google-logo { + max-height : 24px !important; + padding-right : 5px; + + } + +`