angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.69k stars 2.19k forks source link

Signing in using a disabled account, using signInWithPopup, returns an 'Internal Error' #1290

Closed pmullot closed 7 years ago

pmullot commented 7 years ago

Version info

Angular: 4.4.3

Firebase:

AngularFire: 4.0.0-rc.2

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

How to reproduce these conditions

When you try to sign in using a Disabled account (via the Firebase Console), using signInWithPopup, it returns an 'Internal Error'.

Steps to set up and reproduce With a typical login function, as described in all examples and tutorials

login() {
    const provider = new firebase.auth.GoogleAuthProvider();
    this.afAuth.auth.signInWithPopup(provider)
        .then(credential =>  {
            // use credential observable to get user data ...
        // with a disabled user, this is not reached
        })
        .catch(error => {
          console.log(error);
          // error =  {code: "auth/internal-error", message: "An internal error has occurred."}
        });
}

Expected behavior

Returned error should specify "User disabled" or something similar

Actual behavior

Returned error isn't specific enough. It's also misguiding since it refers to an internal error {code: "auth/internal-error", message: "An internal error has occurred."}

davideast commented 7 years ago

@pmullot Can you file this issue in the sdk repo? This is an issue with the core sdk and not AngularFire.

pmullot commented 7 years ago

Done. It's here : Issue 245