abacritt / angularx-social-login

Social login and authentication module for Angular 17
634 stars 387 forks source link

Why are we loading Google login without the user's consent? #524

Closed tawani closed 1 year ago

tawani commented 2 years ago

Why are we loading Google login without the user's consent? I need the user to explicitly click on their social login button. How can we do that?

obrador commented 1 year ago

I don't know if it's the same issue, but when I'm logged in with google, the popup from google that asks to login with google still appears, it shouldn't.

BruneXX commented 1 year ago

Same issue here, I was performing logout and as soon as I redirected to login page the popup comes up, is there any workaround for this? thanks!

sterichards commented 1 year ago

Same here

The Google login appears automatically only by injecting SocialAuthService into a constructor

There is nothing in the documentation that helps me disable that behaviour

I need to launch the Google login modal when I call it to do so

gaessaki commented 1 year ago

This is a bit of a hack, but I set the prompt_parent_id in initOptions to point to a div with display: none; to hide the prompt from the user. Hopefully PR https://github.com/abacritt/angularx-social-login/pull/588 will solve this.

Edit: this isn't recommended apparently and can get your account suspended and also doesn't work on mobile screen resolutions.

gapablaza commented 1 year ago

Try defining "googleLoginOptions" with param "oneTapEnabled" set to "false" when defining the provider in AppModule:

const googleLoginOptions: GoogleInitOptions = {
  oneTapEnabled: false, // default is true
};

  ...
  providers: [
    {
      provide: 'SocialAuthServiceConfig',
      useValue: {
        autoLogin: false,
        providers: [
          {
            id: GoogleLoginProvider.PROVIDER_ID,
            provider: new GoogleLoginProvider(
              environment.google.token,
              googleLoginOptions
            ),
          },
        ],
        onError: (err) => {
          console.error(err);
        },
      } as SocialAuthServiceConfig,
    },
  ],
  ...
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.