ERROR in src/app/services/auth.service.ts:15:21 - error TS2339: Property 'auth' does not exist on type 'Angularfireauth'

Asked

Viewed 220 times

-1

Hello, I’m creating an authentication project with Ionic and firebase, but I came across this error and I can’t fix it. So far the app is only performing the Log in and Log in methods.a propriedade auth está com erro.

1 answer

1

After configuring Angularfire and injecting Angularfireauth you can already use the methods. Without the need for this .auth.

 constructor(
    private firebaseAuth: AngularFireAuth
  ) { 

  }

  ngOnInit(): void {

  }

  async doLogin(user): Promise<void> {
      await this.firebaseAuth.signInWithEmailAndPassword(user.email, user.password)
    }catch(e) {
      alert('Usuário e/ou senha incorreto(s)')
    }  
  }


In your example it would be something like

...

login(user){
   return this.firebaseAuth.signInWithEmailAndPassword(user.email, user.password);
}

...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.