I am L
I am L

Reputation: 4652

Login using Google auth - open in new tab (or open default browser in electron)

I am following this google API docs to login on web apps (without going through backend)

I am on this:

const GoogleAuth = gapi.auth2.getAuthInstance();
GoogleAuth.signIn();

and my gapi.init/gapi.load looks like this:

      gapi.load('auth2', () => {
        gapi.auth2.init({
          client_id: clientId,
          scope: scope.join(' '),
          ux_mode: 'redirect',
          redirect_uri: '<my reirect uri>',
        });
      });

without ux_mode=redirect and redirect_uri this code works and opens a popup, however I'm on an electron app and popup is not allowed by google. I can't change the user agent as well (because it would produce some issues for us on other stuff).

Adding ux_mode=redirect would redirect the electron screen to the google page, and I don't want this, I want it so it will open the default web browser instead (I have a webpage that handles web protocol and stuff).

Any ideas?

Upvotes: 0

Views: 2963

Answers (0)

Related Questions