From 0b1191d09e7f9090ee63a9023766a8986ce00486 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 25 May 2023 19:24:06 -0400 Subject: [PATCH 1/2] redirect UR --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 30ef0c4..6931de2 100644 --- a/.env +++ b/.env @@ -39,7 +39,7 @@ REACT_APP_ZERO_STATE=0 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_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/ REACT_APP_FACEBOOK_CLIENT_ID=390204307987009 REACT_APP_FACEBOOK_CLIENT_SECRET=19f778e312f2ab96d147bacb612910c2 -- 2.34.1 From 00e528eec0d38a8734cbd5086a59cafa97a66cdc Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Fri, 26 May 2023 00:50:42 +0100 Subject: [PATCH 2/2] made google login load on same page --- .env.development | 5 ++++- .env.production | 5 ++++- src/components/AuthPages/Login/index.jsx | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.env.development b/.env.development index 238d521..7783b2d 100644 --- a/.env.development +++ b/.env.development @@ -34,4 +34,7 @@ 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 +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_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/ \ No newline at end of file diff --git a/.env.production b/.env.production index 193f01c..a0da295 100644 --- a/.env.production +++ b/.env.production @@ -34,4 +34,7 @@ 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 +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_GOOGLE_REDIRECT_URL=http://localhost:9082/login/auth/ \ No newline at end of file diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index a17aba1..c39441e 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -121,6 +121,9 @@ export default function Login() { }; const googleLogin = useGoogleLogin({ + flow: 'auth-code', + ux_mode:'redirect', + redirect_uri: process.env.REACT_APP_GOOGLE_REDIRECT_URL, onSuccess: async (tokenResponse) => { console.log(tokenResponse); // const userInfo = await axios.get( @@ -131,6 +134,7 @@ export default function Login() { }, onError: errorResponse => console.log(errorResponse), }); + console.log(process.env.REACT_APP_GOOGLE_CLIENT_ID, process.env.REACT_APP_GOOGLE_REDIRECT_URL) useEffect(()=>{ setMail('') -- 2.34.1