angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Provider Login Method of Redirect Slow in emitting login success

Open un33k opened this issue 10 years ago • 11 comments

Angular: 2.1.0

Firebase: angularfire2 dependency

AngularFire: "angularfire2": "^2.0.0-beta.5"

Other (e.g. Node, browser, operating system) (if applicable): Node: v6.6.0 Chrome (Version 53.0.2785.116 (64-bit)) macOS Sierra

Test case

  1. Load example.com (for the first time)
  2. Click on example.com/account
  3. Get redirected to example.com/login (AuthGuard kicks in)
  4. Click on google login (af.auth.login is triggered - MethodRedirect)
  5. Redirected to Google to authenticate
  6. Redirected back to example.com/login (af.auth.subscribe() is called
  7. example.com/login page loads
  8. 5-7 seconds later af.auth.subscribe(data) kicks in
  9. Get redirected back to example.com/account

Everything works, just too slow. Ng2App is minimal (auth only).

Steps to reproduce

Same as Test case

Expected behavior

af.auth.subscribe() should be snappy right?

Actual behavior

af.auth.subscribe() kicks in too slow as per Test Case. MethodPopup works great however, popup blockers often stop them.

un33k avatar Oct 17 '16 21:10 un33k

same problem

slvn-dev avatar Oct 18 '16 04:10 slvn-dev

@un33k @andlcool We are investigating this now. Hold tight.

davideast avatar Oct 18 '16 22:10 davideast

Fixed in Beta 6 release!

davideast avatar Nov 10 '16 18:11 davideast

@davideast I am still getting this issue while using angularfire beta 7..maybe not 5 sec but 2-3 definitely.

@un33k did you get this working with new beta?

danielpiedra avatar Feb 11 '17 19:02 danielpiedra

@danielpiedra, unfortunately it took too so I went with alternative ways.

un33k avatar Feb 13 '17 14:02 un33k

This is still slow in beta7. Any proposed workaround? Right now I check to see if auth | async is true to decide whether to display a login vs. logout button. But after login, the user sees a login button for another 3-4 seconds, which they keep clicking (and thereby resetting the count).

jmandel avatar Feb 14 '17 02:02 jmandel

I have this issue now

sondresorbye avatar Jul 07 '18 17:07 sondresorbye

This is still slow with latest.

patrickmichalina avatar Jul 17 '18 22:07 patrickmichalina

Still got this issue.

alexAlchemy avatar Nov 01 '18 11:11 alexAlchemy

anyone find a solution to this? Still got this issue

shaagi avatar Feb 05 '19 18:02 shaagi

@shaagi I never did and basically gave up on firebase Auth - the lag was too extreme. I don't know if its the Angular wrapper library or the core library.

patrickmichalina avatar Feb 05 '19 18:02 patrickmichalina