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

137
Views
Google Identity Services Login with React

I'm trying to implement Google Identity Services Login without third parties, everything works well because I get the response when I try to sign in, except for the error shown in the console:

"Failed to load resource: the server responded with a status of 401 ()"

This is my code:

useEffect(() => {
    try {
      google.accounts.id.initialize({
        client_id:
          "CODE.apps.googleusercontent.com",
        callback: handleCallbackResponse,
      });

      google.accounts.id.renderButton(document.getElementById("buttonDiv"), {
        theme: "outline",
        size: "large",
        text: "continue_with",
      });

      window.google.accounts.id.prompt();
    } catch (e) {
      alert("Error", e);
    }
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);


function handleCallbackResponse(response) {
    //code
  }

return (<div id="buttonDiv"></div>)
about 4 years ago · Santiago Trujillo
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!