codediodeio / angular-firestarter

🍱 :fire: Angular + Firebase Progressive Web App Starter
https://firestarter.fireship.io/
956 stars 437 forks source link

Fix: auth guard reactive user detection #92

Closed jornetsimon closed 2 years ago

jornetsimon commented 4 years ago

Fixes #87

miiiguel commented 3 years ago

Hi, man!

Thank you for this fix. I understand how this solution works, however; I'm still wondering why it wasn't working before as a promise.

I mean, the promise returns whether or not the user is logged when changing between routes just fine, but it doesn't when refreshing. I know promises are one-time values, whereas observables are streams of data.

Does it have to do with the fact that the promise has been resolved before and hence the value is lost when refreshing?