Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

417
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda