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

413
Views
The new way of Google sign (popup mode) shows a blank white modal

This is my code i have set up the client ID correctly

once I click a button with id 'buttonDiv', a pop is shown, if no user account exists, i am asked to login, once i login, i have to choose the email to authenticate with, but i get a blank white space instead

import { Box, Button, Typography } from '@mui/material';
import Divider from 'components/Divider';

function handleCredentialResponse(response) {
    console.log("Encoded JWT ID token: " + response.credential);
  }

function GoogleComponent({ action, isLoginPage }) {
  const classes = useStyles();

  window.onload = function () {
    window.google.accounts.id.initialize({
      client_id: process.env.REACT_APP_CLIENT_ID,
      callback: handleCredentialResponse,
      scope: 'email',
      ux_mode: 'popup',
    });
    window.google.accounts.id.renderButton(
      document.getElementById("buttonDiv"),
      { theme: "outline", size: "large" }  // customization attributes
    );
    window.google.accounts.id.prompt(); // also display the One Tap dialog
  }
 
    return (
      <Box className={classes.box}>
         <div id="buttonDiv"></div> 
      </Box>
    );
  }

  export default GoogleComponent;

when I change the ux_mode: 'redirect' it works but that's not how I want it.

I need a pop up to return a code and then use the code to make a post request to the backend API

I have added the http://localhost and http://localhost:3000 to the authorised domains on the cloud console.

what could I be missing?

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

0

Try looking at the console of the blank popup window (right-click -> Inspect -> Console). It might offer some insights on the reason for its failure to render.

For example, I get "[GSI_LOGGER]: The given origin is not allowed for the given client ID". Your problem is probably something else because 'redirect' works for you (for me it fails with same error), but at least an error might point you in the right direction.

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!