diff --git a/.env b/.env index 0b4c923..30ef0c4 100644 --- a/.env +++ b/.env @@ -34,5 +34,17 @@ REACT_APP_ITEM_PER_PAGE=5 # Empty Listings REACT_APP_ZERO_STATE=0 +#REACT_APP_GOOGLE_CLIENT_ID_RET=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com + +REACT_APP_GOOGLE_CLIENT_ID=817021856543-ad9nsjgdpsu2s2jrl63j3ihrv7lbf6ma.apps.googleusercontent.com +REACT_APP_GOOGLE_CLIENT_SECRET=aozK_2G8UjaCmLgPPkv9abIm +REACT_APP_GOOGLE_CLIENT_SCOPE="https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile" + + +REACT_APP_FACEBOOK_CLIENT_ID=390204307987009 +REACT_APP_FACEBOOK_CLIENT_SECRET=19f778e312f2ab96d147bacb612910c2 +REACT_APP_FACEBOOK_CLIENT_SCOPE="email, public_profile" + + #apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 diff --git a/.env.development b/.env.development index 3efdd7a..238d521 100644 --- a/.env.development +++ b/.env.development @@ -33,3 +33,5 @@ REACT_APP_ITEM_PER_PAGE=5 #apigate.lotus.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 + +REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com \ No newline at end of file diff --git a/.env.production b/.env.production index 6d4177b..193f01c 100644 --- a/.env.production +++ b/.env.production @@ -33,3 +33,5 @@ REACT_APP_ITEM_PER_PAGE=5 #apigate.orion.g1.wrenchboard.com:76.209.103.227 #apigate.orion.g1.wrenchboard.com:76.209.103.227 + +REACT_APP_GOOGLE_CLIENT_ID=234407841224-k5g7f67p908hqtegiokmjqt8qqf3hi2i.apps.googleusercontent.com \ No newline at end of file diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index a22dd60..a17aba1 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -8,8 +8,8 @@ import WrenchBoard from "../../../assets/images/wrenchboard.png"; import usersService from "../../../services/UsersService"; import InputCom from "../../Helpers/Inputs/InputCom"; import AuthLayout from "../AuthLayout"; -//import { GoogleOAuthProvider } from '@react-oauth/google'; -// import { googleLogout, useGoogleLogin } from '@react-oauth/google'; +// import { GoogleOAuthProvider } from '@react-oauth/google'; +import { googleLogout, useGoogleLogin } from '@react-oauth/google'; import { useDispatch } from "react-redux"; import { updateUserDetails } from "../../../store/UserDetails"; @@ -120,6 +120,18 @@ export default function Login() { }); }; + const googleLogin = useGoogleLogin({ + onSuccess: async (tokenResponse) => { + console.log(tokenResponse); + // const userInfo = await axios.get( + // 'https://www.googleapis.com/oauth2/v3/userinfo', + // { headers: { Authorization: `Bearer ${tokenResponse.access_token}` } }, + // ); + // console.log(userInfo); + }, + onError: errorResponse => console.log(errorResponse), + }); + useEffect(()=>{ setMail('') setPassword('') @@ -246,7 +258,7 @@ export default function Login() {