流星Accounts.loginWithPassword"400匹配失败";错误 [英] Meteor Accounts.loginWithPassword "400 Match Failed" Error

查看:78
本文介绍了流星Accounts.loginWithPassword"400匹配失败";错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩Angular Meteor教程,该教程使用Ionic来创建WhatsApp克隆.我使用用户名/密码将电话验证更改为普通用户设置.

I'm playing around with the Angular Meteor tutorial that uses Ionic to create a WhatsApp Clone. I changed the phone verification to a normal user setup using username/password.

使用

    Accounts.createUser(email,password,callback)

当他们注销并尝试重新登录时,我有一个现有用户可以用来填写其电子邮件和密码的表格.我无法获得

When they logout and attempt to log back in, I have a form that an existing user can use to fill in their email and password. I cannot get the

    Meteor.loginWithPassword(email,password,callback)

适用于这种情况的方法;它总是说我有一个400错误,即匹配失败".下面是我的代码,用于在创建帐户后登录用户:

method to work for this scenario; it keeps saying that I have a 400 error, which is "Match failed". Below is my code for logging in to a user once the account has already been created:

表格:

    <label class="item item-input">
        <input ng-model="logger.existingEmail" on-return="logger.loginExistingUser()" type="text" placeholder="Your existing email">
    </label>
    <br>
    <label class="item item-input">
        <input ng-model="logger.existingPassword" on-return="logger.loginExistingUser()" type="text" placeholder="Your existing password">
    </label>

JS:

    login() {
      if (_.isEmpty(this.existingEmail) ||_.isEmpty(this.existingPassword)) return;
      Meteor.loginWithPassword(this.existingEmail,this.existingPassword,function(err){
        if(err){
          console.log(err);
        }
      });
    }

  • 我创建了多个帐户并尝试了以下操作:
    • 使用电子邮件和密码登录
    • 使用用户ID和密码登录(用户ID在mongodb中生成)
    • 直接将电子邮件和密码传递到Meteor.loginWithPassword
    • 直接将用户ID传递给Meteor.loginWithPassword
    • 变量在Meteor.loginWithPassword调用之前有效.

      The variables are valid just before the Meteor.loginWithPassword call.

      我正在使用:

          accounts-password 1.3.3
          meteor 1.4.2.3
      

      有什么提示吗?很抱歉,帖子的格式不佳,我很着急,只想提出这个问题.预先谢谢你!

      Any tips? Sorry about the poor format of the post, I'm in a hurry and just wanted to get this question up. Thank you in advance!

      推荐答案

      已解决.程序包

          mys:accounts-phone
      

      是导致错误的原因.删除了此软件包,登录正常.

      was causing the error. Removed this package and login works as normal.

      这篇关于流星Accounts.loginWithPassword"400匹配失败";错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆