Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

login button is disabled in Production #563

Open
Abhinav1182 opened this issue Feb 24, 2023 · 5 comments
Open

login button is disabled in Production #563

Abhinav1182 opened this issue Feb 24, 2023 · 5 comments

Comments

@Abhinav1182
Copy link

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

But not working in Production

@KasunSKarunasekara
Copy link

Facing the same issue. Any solutions?

@nehatkkhan786
Copy link

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

@asinha0609
Copy link

asinha0609 commented Feb 27, 2023

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

@nehatkkhan786
Copy link

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
Copy link

nehatkkhan786 commented Feb 28, 2023

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
``
and call the above login function on the custom button it will work fine. Just now I fixed my stuff with this package .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants