Skip to content

Documentation for @angular/fire v6 seems outdated or even more breaking changes #2310

Description

@paulstelzer

Version info

Angular: 9.0.0-rc.13

Firebase: 7.8.0

AngularFire: 6.0.0-rc.0

How to reproduce these conditions

I have updated from @angular/fire 5 to 6 and adjusted my application like mentioned in https://github.com/angular/angularfire/blob/master/CHANGELOG.md

But it seems that @angular/fire/auth has even more breaking changes like mentioned. The documentation is the same for v6 like for v5 (https://github.com/angular/angularfire/blob/master/docs/auth/getting-started.md)

The example in documentation still says:

  constructor(public afAuth: AngularFireAuth) {
  }
  login() {
    this.afAuth.auth.signInWithPopup(new auth.GoogleAuthProvider());
  }
  logout() {
    this.afAuth.auth.signOut();
  }

But then it says: Property 'auth' does not exist on type 'AngularFireAuth'.

And it's right -> auth isn't anymore in https://github.com/angular/angularfire/blob/master/src/auth/auth.ts

You only return the auth (return ɵlazySDKProxy(this, auth, zone);)

So is it correct to write this.afAuth.signOut(); ?

But then everything is a promise. In v5 I could write: "const current = this.afAuth.auth.currentUser;", but in v6 it's a promise -> "const current = await this.afAuth.auth.currentUser"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions