I want to modify this Notes app to work with email/password logins instead of using google accounts:
Build a Progressive Web App with Firebase, Polymerfire and Polymer Components
<firebase-auth
id="auth"
app-name="notes"
provider="google"
signed-in="{{signedIn}}"
user="{{user}}">
</firebase-auth>
<script>
Polymer({is: 'note-app', behaviors: [Polymer.NoteAppBehavior],
signIn: function() {this.$.auth.signInWithPopup();}});
</script>
I've identified the method here: FirebaseExtended/polymerfire/firebase-auth.html
Instead of signInWithPopup()
, I need signInWithEmailAndPassword()
:
/**
* Authenticates a Firebase client using an email / password combination.
*
* @param {!String} email Email address corresponding to the user account.
* @param {!String} password Password corresponding to the user account.
* @return {Promise} Promise that handles success and failure.
*/
signInWithEmailAndPassword: function(email, password) {
return this._handleSignIn(this.auth.signInWithEmailAndPassword(email, password));
},
I'm using this:
and access auth by this:
But first you need to enable the email password authentication method from firebase console to be able to use the email password authentication.