Cannot read property 'signInWithEmailAndPassword' of undefined in firebase-auth
dman777 opened this issue · 2 comments
dman777 commented
Description
Polymer 1.9.3
Firebase 4.6.0
firebase-auth gives Cannot read property 'signInWithEmailAndPassword' of undefined
in return this._handleSignIn(this.auth.signInWithEmailAndPassword(email, password));
on line 211 in firebase-auth.html.
Expected outcome
signInWithEmailAndPassword
method should be on this.auth
Both firebase-app.html and firebase-auth.html are loading fine. Am I doing something wrong?
<firebase-app
auth-domain="dolphin-1488854098062.firebaseapp.com"
api-key="AIzaSyCThvZN7ezmGOQf1JQNwnePhvsV6Z-dvT4"></firebase-app>
<firebase-auth
id="auth"
on-error="showError"></firebase-auth>
...
_submit: function(e) {
if (e) { e.preventDefault(); }
console.log(this.$.auth); // ELEMENT SHOWS FINE IN CONSOLE
this.$.auth.signInWithEmailAndPassword(this.email, this.password);
this.email = null;
Browsers Affected
- [X ] Chrome
- Firefox
- Safari 9
- Safari 8
- Safari 7
- Edge
- IE 11
- IE 10
phidias51 commented
You're missing database-url attribute from your app element, and the app-name attribute from your auth element.
dman777 commented
Thanks, the database-url
in firebase-app worked. It didn't like the app-name
in the firebase-auth....fair warning to anyone else reading this.