react-google-login icon indicating copy to clipboard operation
react-google-login copied to clipboard

login button is disabled in Production

Open Abhinav1182 opened this issue 1 year ago • 5 comments

in google console under Authorized JavaScript origins I added https://localhost/, And it worked for DEV

But not working in Production

Abhinav1182 avatar Feb 24 '23 06:02 Abhinav1182

Facing the same issue. Any solutions?

KasunSKarunasekara avatar Feb 24 '23 13:02 KasunSKarunasekara

I am also facing the same issue guys. Did you get any alternate solution? Please help me out

nehatkkhan786 avatar Feb 26 '23 19:02 nehatkkhan786

Facing the same issue on production, working fine for windows but MacBook.

asinha0609 avatar Feb 27 '23 06:02 asinha0609

https://www.npmjs.com/package/@react-oauth/google?activeTab=readme guys try this library working fine. I just fixed my issue with this library.

nehatkkhan786 avatar Feb 28 '23 16:02 nehatkkhan786

https://www.npmjs.com/package/@react-oauth/google?activeTab=readme guys try this library working fine. I just fixed my issue with this library.

import { useGoogleLogin } from '@react-oauth/google'; const login = useGoogleLogin({ onSuccess: async(response)=>{ try { const {data} = await axios.post('backendurl/', {'access_token':response.access_token}, { headers:{ 'content-type': 'application/json' } }) dispatch({ type :'USER_LOGIN', payload :data }) localStorage.setItem('userLoginDetails', JSON.stringify(data)) navigate(-1) toast.success('Login in Successfully ') console.log(response) } catch (error) { toast.error('Something Went Wrong') } } })

` <Button size='small' startIcon={<Box component='img' src={GoogleLogo} sx={{width:40, height:40}}/>} variant='contained' sx={{backgroundColor:'black', color:'white' , ':hover':{backgroundColor:'black'}}} onClick = {()=>{login()}}> Sign in with Google </Button>`` and call the above login function on the custom button it will work fine. Just now I fixed my stuff with this package .

nehatkkhan786 avatar Feb 28 '23 16:02 nehatkkhan786