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

299
Views
Google OAuth2 results in 'pop_up_closed_by_user'

I have a Vue/Django app that I'd like to have login with Google. My code is below:

Google API initialization :

import { gapi } from "gapi-script";

gapi.load("client:auth2", () => {
  gapi.client.init({
    clientId: '887210531667-lvd6kkdqmei6c5uavr5eaa6k0lfj99tr.apps.googleusercontent.com',
    scope: 'profile email',
    prompt: 'select_account'
  });
});

Login call to Google:

loginWithGoogle () {
      gapi.auth2.getAuthInstance().signIn()
      .then(
          user => {
            console.log('Login successfull')
          },
          err => {
            console.log('Login error')
          }
        )
      gapi.auth2.getAuthInstance().isSignedIn.listen((isSignedIn) => {
        console.log('isSignedIn: ' + isSignedIn)
      })
    },

After login call, popup appears and I select my user - after that no additional page is displayed in popup(I expect to see what information the app requests is shown). And call results in 'pop_up_closed_by_user' error. What's wrong with my approach?

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

ux_mode parameter when intializing gapi client needs to be set to popup as below.

gapi.load("client:auth2", () => {
  gapi.client.init({
    clientId: '887210531667-lvd6kkdqmei6c5uavr5eaa6k0lfj99tr.apps.googleusercontent.com',
    scope: 'profile email',
    prompt: 'select_account',
    ux_mode: 'popup'
  });
});

Then it worked.

about 4 years ago · Santiago Gelvez 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!