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

521
Visualizações
Using GIS (Google Identity Services) and API Subpackage (picker) without client package

I am currently replacing the gapi.oauth2 package, by using the TokenClient according to the guide and everything works fine.

global.google.accounts.oauth2
        .initTokenClient({
            client_id: CONFIG.google.clientId,
            scope: 'https://www.googleapis.com/auth/drive.readonly',
            ux_mode: 'popup',
            callback(tokenResponse) {
                if (tokenResponse && !tokenResponse.error) {
                    onSuccess(tokenResponse.access_token);

                    return;
                }

                onError(tokenResponse.error || 'google authentication failed');
            },
        })
        .requestAccessToken({});

The only issue is that we are not using the gapi.client and would prefer avoiding loading that package as we are only using the token to show a picker by using google.picker.PickerBuilder. Now after the initialization the GSI package tries to use gapi.client.setToken() which obviously fails as the package is not loaded.

[GSI_LOGGER-TOKEN_CLIENT]: Set token failed. Gapi.client.setToken undefined.

So now i could not find anything in the reference on how to prevent that call to happen, nor how to at least suppress the warning by not e.g hacking in a noop as a placeholder.

Does anyone know if there is any official way to deal with that ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

In my tests the access token is successfully returned to the callback handler.

It looks to be an incorrectly generated warning, annoying yes, but functionally you're okay. A later, official release should remove the warning with no action on your part required.

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