angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

AngularFireAuthGuard interferes with bindings

Open chrisdrobison opened this issue 6 years ago • 28 comments

Version info

Angular: 9.0.2

Firebase: 7.15.0 AngularFire: 6.0.0-rc1

Other (e.g. Ionic/Cordova, Node, browser, operating system): Chrome 80

How to reproduce these conditions

Steps to set up and reproduce

  1. Add AngularFireAuthGuard to a route
  2. Create reactive form
  3. Add some output areas to see values update

I've attached a sample project. Just updated the environment files with your own Firebase config. Look at the /login route.

admin-angular.zip

With the guard in place, on /login you will see that typing in anything in those form fields results in no binding updates, nothing happens. Remove the auth guard from the route for /login and the bindings start working again. I added my own trivial auth guard and bindings still work so there looks to be an issue with the angular fire auth guard.

Debug output

** Errors in the JavaScript console **

There are no errors in the console.

Expected behavior

  1. Bindings should update

Actual behavior

  1. Nothing happens

chrisdrobison avatar Mar 16 '20 21:03 chrisdrobison

@leandroz You are right, I noticed a difference in behavior when using child routes. At least for me, I could fix it by forcing everything into the Angular zone. The gist has been updated accordingly

vsaw avatar May 18 '20 10:05 vsaw

Maybe the guards should be allowed to run outside of zone and then it's an @angular/router issue https://github.com/angular/angular/issues/37223 😉

This will clearly happen again with other apps and libs.

yjaaidi avatar May 20 '20 17:05 yjaaidi

Any resolution on this issue?

gleno avatar May 26 '20 20:05 gleno

Also started experiencing this issue and its a blocker for us to move to production

Ross-Rawlins avatar Jun 15 '20 13:06 Ross-Rawlins

Also started experiencing this issue and its a blocker for us to move to production

it block my project too.

longcharmroeun avatar Jun 21 '20 02:06 longcharmroeun

Guys if it’s blocking write your own guards.

On Sat, 20 Jun 2020 at 23:00 Longcharmroeun [email protected] wrote:

Also started experiencing this issue and its a blocker for us to move to production

it block my project too.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angularfire/issues/2355#issuecomment-647067812, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDJDUW7TFLUAGM4I27PTF3RXVST5ANCNFSM4LMWFUTQ .

-- Leandro Zubrezki Freelance Software Developer

leandroz avatar Jun 21 '20 17:06 leandroz

is this issue resolved?

yasinkocak avatar Jul 10 '20 13:07 yasinkocak

yes, it's been resolve in recent patches

jamesdaniels avatar Nov 14 '20 05:11 jamesdaniels