'auth/popup-closed-by-user error only facebook autehntication on firebase auth

I am trying to use the Javascript client library for Firebase auth to sign in via Google, Facebook and Apple . However, when I try to sign in through facebook, the signin window pops up, enter my credentials and shortly after I get the following error message:

code: "auth/popup-closed-by-user"

message: "The popup has been closed by the user before finalizing the operation."

This issue is occurs only Facebook. Google and Apple signing working fine. And also I

added the domain in authorized domains in firebase console .

Here is my code for facebook signin :

facebookAuth() {
    return this.AuthLogin(new firebase.auth.FacebookAuthProvider());
  }
 AuthLogin(provider: any) {
    return this.afAuth.signInWithPopup(provider)
      .then((result) => {
        console.log(result.user.uid)     
      }).catch((error) => {
        console.log(error)
      })
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source