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

393
Views
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
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!