diff --git a/src/Components/LoginContainer.js b/src/Components/LoginContainer.js index 17abd86be24d0822d7384858b95a94776702c280..9f7393fdb1dd9302280d0307d8945a1795522d0e 100644 --- a/src/Components/LoginContainer.js +++ b/src/Components/LoginContainer.js @@ -18,6 +18,7 @@ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/> import React, {Component} from "react"; import GoogleLogin from 'react-google-login' import { Button } from '@material-ui/core'; +import MeuBotaoGoogle from './MeuBotaoGoogle' //import FacebookLogin from 'react-facebook-login'; import CloseIcon from '@material-ui/icons/Close'; import styled from 'styled-components' @@ -89,15 +90,16 @@ class LoginContainer extends Component { <div style={{paddingTop: "20px"}}> <div style={{marginTop:"0"}}> - <StyledGoogleLoginButton + {/*<StyledGoogleLoginButton clientId="288460085642-k4veg4fo8kddvjer8b055n9da5qtgha7.apps.googleusercontent.com" onSuccess={responseGoogle} onFailure={responseGoogle} login={"reponseType" : 'code'} cookiePolicy={'single_host_origin'} - > <span style={{textTransform:"none", fontSize:"13px"}}>Usando o Google</span> </StyledGoogleLoginButton> + >*/} + <MeuBotaoGoogle/> </div> </div> @@ -210,7 +212,7 @@ const LeftSideStrikedH3 = styled.div` margin-left : 5px; width : 45%; ` -const StyledGoogleLoginButton = styled(GoogleLogin)` +export const StyledGoogleLoginButton = styled(GoogleLogin)` background-color: fff; border : 1px solid rgb(66, 133, 244); box-shadow: 0 0 0 1px #4285f4 !important; diff --git a/src/Components/MeuBotaoGoogle.js b/src/Components/MeuBotaoGoogle.js new file mode 100644 index 0000000000000000000000000000000000000000..6d0a0f07437cdf2988943e8dead6e084af44071c --- /dev/null +++ b/src/Components/MeuBotaoGoogle.js @@ -0,0 +1,19 @@ +import React, {useState} from 'react' +import { Button } from '@material-ui/core'; +import {StyledGoogleLoginButton} from './LoginContainer' +import axios from 'axios' +import {apiUrl} from '../env'; + +export default function MeuBotaoGoogle (props) { + + const handleAuthentication = () => { + axios.get('https://accounts.google.com/o/oauth2/v2/auth?scope=openid%20profile%20email&redirect_uri=http://api.portalmec.c3sl.ufpr.br/v1/omniauth/google_oauth/callback&reponse_type=token&client_id=288460085642-k4veg4fo8kddvjer8b055n9da5qtgha7.apps.googleusercontent.com').then( + (response) => console.log(response), + (error) => console.log(error), + ) + } + + return( + <Button onClick={handleAuthentication}>Entrar com o Google</Button> + ) +} diff --git a/src/Store.js b/src/Store.js index c2e0f669847b6a71faf2f77f73dd079e27a8ab24..d2befcd749d4317d9e3dc539bb26978934f08979 100644 --- a/src/Store.js +++ b/src/Store.js @@ -22,7 +22,7 @@ export const Store = React.createContext() const initialState = { searchOpen: false, - userIsLoggedIn : true, + userIsLoggedIn : false, userAgreedToPublicationTerms: false, userAgreedToPublicationPermissions: false, modalColaborarPlataformaOpen : false,