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('')