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

Missing required parameter #537

Open
SultanHboush opened this issue Aug 17, 2022 · 4 comments
Open

Missing required parameter #537

SultanHboush opened this issue Aug 17, 2022 · 4 comments

Comments

@SultanHboush
Copy link

SultanHboush commented Aug 17, 2022

I dont why i'm getting this error!

{
"message": "Missing required parameter 'client_id'",
"SQ": true
}

This the code:

<GoogleLogin
clientId={process.env.REACT_APP_GOOGLE_CLIENT_ID}
buttonText="Log in with Google"
onSuccess={handleLogin}
onFailure={handleLogin}
cookiePolicy={'single_host_origin'}
/>

Please note that the button is disabled also !

@Malankar
Copy link

are you using vite or create react app?

@SultanHboush
Copy link
Author

@Malankar create react app

@Malankar
Copy link

Debuging:

Check if the name matches the name in env file
First console log the env variable and see what it is giving you in the console

console.log(process.env.REACT_APP_GOOGLE_CLIENT_ID)

Alternative:
For testing purpose try hard coding the value instead of referencing it via a variable because might find some other errors as well

<GoogleLogin
    clientId="Your ID"
    buttonText="Log in with Google"
    onSuccess={handleLogin}
    onFailure={handleLogin}
    cookiePolicy={'single_host_origin'}
/>

@SultanHboush
Copy link
Author

@Malankar I tried it, but it gives me the same error!

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

2 participants