Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何修改此PolymerFire/Firebase教程以使用电子邮件/密码登录而不是google帐户?_Javascript_Firebase_Polymer_Polymerfire - Fatal编程技术网

Javascript 如何修改此PolymerFire/Firebase教程以使用电子邮件/密码登录而不是google帐户?

Javascript 如何修改此PolymerFire/Firebase教程以使用电子邮件/密码登录而不是google帐户?,javascript,firebase,polymer,polymerfire,Javascript,Firebase,Polymer,Polymerfire,我想修改此Notes应用程序以使用电子邮件/密码登录,而不是使用google帐户: 我用这个: <firebase-auth id="auth" user="{{user}}" on-error="_loginError"></firebase-auth> <paper-dialog id="authDialog" modal with-backdrop> <paper-input label="Email" value="{{signinEmai

我想修改此Notes应用程序以使用电子邮件/密码登录,而不是使用google帐户:

我用这个:

<firebase-auth id="auth" user="{{user}}" on-error="_loginError"></firebase-auth>
<paper-dialog id="authDialog" modal with-backdrop>
  <paper-input label="Email" value="{{signinEmail}}"></paper-input>
  <paper-input label="Password" value="{{signinPassword}}" type="password"></paper-input>
  <div class="buttons">
    <paper-button on-click="_signIn" raised>Sign in</paper-button>
  </div>
</paper-dialog>

但首先,您需要从firebase控制台启用电子邮件密码身份验证方法,以便能够使用电子邮件密码身份验证。

如果您现在才开始,最好使用最新版本,如Polymer 3。。但是如果你真的想要聚合物1。。你试过什么吗?你有什么问题?
    /**
     * 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));
    },
<firebase-auth id="auth" user="{{user}}" on-error="_loginError"></firebase-auth>
<paper-dialog id="authDialog" modal with-backdrop>
  <paper-input label="Email" value="{{signinEmail}}"></paper-input>
  <paper-input label="Password" value="{{signinPassword}}" type="password"></paper-input>
  <div class="buttons">
    <paper-button on-click="_signIn" raised>Sign in</paper-button>
  </div>
</paper-dialog>
  _signIn: function() {
    this.$.auth.signInWithEmailAndPassword(this.signinEmail, this.signinPassword)
      .then(function(response) {
        console.log(response);
      }.bind(this), function(error) {
        this.$.toast.show({text: '' + error});
      }.bind(this))
      .catch(function(error) {
        this.$.toast.show({text: '' + error});
      }.bind(this));
  },