Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
React-google-login popup close immediately

I use React-google-login to sign up and log in with a google account in my app I use a client id to test it. this is my login component import:

<GoogleLogin
 icon={false}
 className="input-rounded d-flex"
 clientId="....."
 onSuccess={() => handleGoogleSignUp}
 onFailure={() => handleGoogleSignUp}
 cookiePolicy={"single_host_origin"}
>
  <div
    role="button"
    className="m-0 google-signin d-flex"
  >
    img src={vector} alt="vector" className="me-2" />
   <div>Sign up with Google</div>
  </div>
</GoogleLogin>

this is my function:

const handleFailure = (err) => {
    console.log(err);
};

const handleSucsess = (res) => {
     console.log(res);
}

but when click on the google button the popup close immediately and I can't choose one account can anybody help me?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to pass in the response as mentioned here in the official package documentation Visit https://www.npmjs.com/package/react-google-login

const responseGoogle = (response) => {
  console.log(response);
}

ReactDOM.render(
  <GoogleLogin
    clientId=""
    buttonText="Login"
    onSuccess={responseGoogle}
    onFailure={responseGoogle}
    cookiePolicy={'single_host_origin'}
    isSignedIn={true} //Keeps user signed in
  />,
  document.getElementById('googleButton')
);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!