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

394
Visualizações
Google sign in response_type=code not working

I am implementing google sign-in in my Nuxtjs project and response_type:'code' is not working either in ux_mode:'popup' nor ux_mode:'redirect' in both modes when I check the url reponse_type is equal to permission not code even though I have specified it should be code, in popup mode the popup closes and return popup closed by user error and in redirect mode if I change response_type to code in the url then everything works well so it just needs to be code for everything to work.

here is my google sign in code:

<button role="button" class="btn-social" @click.stop="signInWithGoogle()">
  <img src="~/assets/icons/google.svg" alt="" class="lg:block hidden">
  With Google
</button>

the method:

signInWithGoogle() {
  gapi.auth2.getAuthInstance().signIn();
}

and the initialization:

gapi.load('client:auth2', () => {// callback function});
  gapi.client.init({
    clientId: process.env.GOOGLE_CLIENT_ID,
    discoveryDocs: ['https://www.googleapis.com/discovery/v1/apis/oauth2/v2/rest'],
    scope: 'profile email',
    ux_mode: 'popup',
    redirect_uri: 'http://lvh.me:8000/googleRedirect',
    response_type: 'code',
    access_type: 'offline',
    include_granted_scopes: true,
    prompt: 'select_account',
  });
})

note: I have added URL and redirect URLs in my google console so there is no redirect URI mismatch error.

about 4 years ago · Juan Pablo Isaza
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