Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase / typescript issue - When I use this.ref.getAuth().password.email it works but I get FirebaseAuthData type error

Firebase / typescript issue.

When I use this.ref.getAuth().password.email it works but I get FirebaseAuthData type error when I run typescript compiler?

Do I need to update my typescript version?

I'm using typescript version 1.7.3 https://code.angularjs.org/tools/typescript.js

Or maybe my version of firebase which is currently at: 2.3.2?

This is the error I get in the typescript compiler:

enter image description here

like image 371
AngularM Avatar asked Sep 25 '22 18:09

AngularM


1 Answers

FirebaseAuthData Interface doesn't contain any password attribute after seeing the docs posted by Kamen Minkov.

after reviewing your code snippet , you can rewrite it as

var authData:FirebaseAuthData = this.ref.getAuth(); 
var email = authData['password']['email'];

this will probably not throw any ts compiler errors

like image 80
Nabeel Hassan Avatar answered Oct 12 '22 11:10

Nabeel Hassan