angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Google signin with popup not working in lazy loaded routes that are part of a module

Open prototorpedo opened this issue 3 years ago • 3 comments

Version info Angular: 13.2

Firebase: 9.6.7

AngularFire: 7.2.1

How to reproduce these conditions Created a new angular 13 app, created an authentication module that contains login / register / forgot password, lazy loaded that module in the routing module. Attempting google signingWithPopup from the login component does not work, only refreshes the page. Attempting the same thing in AppComponent works!

Steps to set up and reproduce

  • create a new angular app w/ routing
  • create an auth module
  • create a login component as part of this module
  • lazy load said module in the app-routing module
  • try the google signin from the login component
  • it refreshes the page, with no pop up presented

Sample data and security rules

None

Debug output

There is no error produced, just a page refresh

Expected behavior

Google signing popup should be fired from any module / component

Actual behavior

It is only fired from the AppComponent, or from components loaded directly in the routes

prototorpedo avatar Mar 03 '22 10:03 prototorpedo

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Mar 03 '22 10:03 google-oss-bot

It is presented in my code please check if your browser is blocking popups it usually happens in modern browsers.

Sapython avatar Mar 09 '22 13:03 Sapython

And this is the correct method to invoke the popup in the V9 modular.

signInWithPopup(this.auth, new GoogleAuthProvider()).then(async (credentials:UserCredential)=>{})

Sapython avatar Mar 09 '22 13:03 Sapython