Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AngularFireAuth doesn't emit new value #264

Closed
orangesoup opened this issue Jun 21, 2016 · 5 comments
Closed

AngularFireAuth doesn't emit new value #264

orangesoup opened this issue Jun 21, 2016 · 5 comments

Comments

@orangesoup
Copy link

As mentioned in #231, when the user object from localStorage is deleted or we simply logout we get a null object which is fine. However, if we try to log in again AngularFireAuth doesn't emit any new value.

AuthService constructor:

this.af.auth.subscribe(user => console.log(user));

Reproduce: (Loading the page (with an existing object in localStorage))

- initial page load: Object {auth: V, uid: "some random uid", provider: 4}
- after logout / deleting object from localStorage: null
- login again: nothing happens
@davideast
Copy link
Member

This is fixed in the latest release. Can you try again?

@orangesoup
Copy link
Author

@davideast Updated to beta.2, but the problem still exists for me.

@jeffbcross
Copy link
Contributor

@orangesoup to clarify, you're not editing localStorage directly, right? It's just the Firebase SDK deleting the item? And you're using Email/Password authentication, correct?

@orangesoup
Copy link
Author

@jeffbcross It doesn't work either way, but yeah. Basically I'm logging in with email/password. So the steps are:

  • login with email / pass -> I get the user object (FirebaseAuthState)
  • logout with af.auth.logout() -> I get null
  • login again with email / pass -> I get nothing, not even null, nothing. The login still works, but at this point I can only get the user object from the login promise and have to pass it back to the auth service instead of directly getting it from the subscription

@orangesoup
Copy link
Author

@jeffbcross I've updated the CLI, Angular, AngularFire, everything basically, created a brand new project and the problem doesn't seem to exist there, so I'll close the issue. Honestly, I have no idea what's wrong in the old project, but the problem seems to be gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants