Error found when attempting to log in with the Meteor Accounts.loginWithPassword function: "400 Match Failed"

Currently, I am experimenting with the Angular Meteor tutorial that utilizes Ionic to build a WhatsApp Clone. I decided to modify the phone verification process and opted for a standard user setup using username/password instead.

New accounts are now created through the following method:

    Accounts.createUser(email,password,callback)

After logging out, users can log back in by completing a form with their email and password. However, I encountered an issue while trying to use the

    Meteor.loginWithPassword(email,password,callback)

method; it continuously returns a 400 error code, specifically prompting "Match failed". Below is my current code snippet for handling user login after account creation:

Login Form:

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

JavaScript Function:

    login() {
      if (_.isEmpty(this.existingEmail) ||_.isEmpty(this.existingPassword)) return;
      Meteor.loginWithPassword(this.existingEmail,this.existingPassword,function(err){
        if(err){
          console.log(err);
        }
      });
    }
  • I have tried various methods including:
    • Logging in with email and password
    • Logging in with user id and password (user id generated in MongoDB)
    • Directly passing email and password to Meteor.loginWithPassword
    • Passing user id directly to Meteor.loginWithPassword

The variables have been confirmed as valid right before executing the Meteor.loginWithPassword function.

Current Environment:

    accounts-password 1.3.3
    meteor 1.4.2.3

If you have any tips or suggestions, please feel free to share. Apologies for the rushed format of this post; I just wanted to get this question out there quickly. Thank you for your help!

Answer №1

Solved: The issue stemmed from the package

    mys:accounts-phone

Upon removing this package, the login function returned to normal operation.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Inaccurate data being inserted into MongoDB

I've been struggling with this code, trying to figure out the solution to the problem I'm facing. Here is the schema for the MongoDB document: { "brand" : "String", "series" : "String", "model" : "String", "deviceType" : "String ...

Utilize the outcome of a prior query to search through the Mongodb database

I have multiple inquiries regarding the same collection: First Query: db.getCollection('messagelogs').find({'intents.intent':'General_Positive_Feedback'},{'currentStep':1,'_id':0}) Result of First Query: ...

JavaScript: Only a single function call is successful

Recently, I encountered an issue with my registration form. Everything was working smoothly until I attempted to add a new onblur() event to a different text field within the same form. Surprisingly, this caused the original ajax call to stop functioning, ...

Having trouble displaying a pre-designed 3D model in three.js

I would greatly appreciate it if someone could provide an example and elaborate on how to render a 3D object using three.js or similar libraries. The model already exists, so the focus is solely on rendering it effectively. Can you please guide me throug ...

Eliminate the need to input the complete URL every time when making server calls

Currently, my springbok application has a React-Typescript frontend that is functioning well. I am using the request-promise library to make requests like this: get('http://localhost:8080/api/items/allItems', {json: true}). However, I would like ...

Experiencing problems with the response from the Netlify Lambda function.. consistently receiving undefined results

I've been working on setting up a lambda function to handle authentication, validation, and sending of a contact form. As I'm new to lambda functions, my code might have some flaws. However, despite my efforts, I am struggling to modify the resp ...

Implementing Ext JS Checkbox Inside a Row Editor

Does anyone have a solution for aligning the checkbox in a RowEditor to the center position? I am using the "triton" theme with Ext JS 6.0.0. The issue is that the checkbox is currently placed at the top of the row, while other fields like textfield or co ...

How can I store an access token received from the backend (in JSON format) in local storage and use it to log in?

My goal is to create a login interface using Plain Javascript. I have obtained a Token from the backend and now need assistance in utilizing this Token for the login process and storing it in LocalStorage. Although I have successfully made the API call, I ...

The validation of Google Recaptcha is malfunctioning when used on a local server

Has anyone successfully validated Google reCAPTCHA on localhost? I'm having issues getting it to work properly. Any recommendations for the best solution? ...

Issues with validating custom instance or static methods within a Mongoose schema

Within my Mongoose model, I have defined a Meeting schema that includes a description, maximum number of participants, and an array of participant references: var MeetingSchema = new Schema({ description: { type: String }, maxNumberOfP ...

Maintaining an onExit function in the ui-router framework

I am trying to implement an animation on an element within a page when the user is transitioning out of a state. Here is my current code snippet: { ....., views: { ... }, onExit: function(){ someEle.classList.remove("someClass"); // ...

"Implementing Google Maps into a React application: A step-by-step guide

I am currently utilizing webpack and reactjs in my project and I am looking to integrate the Google Maps API. First step was to add "react-google-maps": "^4.9.1" in my package.json file. Below is the code for my component class. import React, {PropTypes, ...

Obtain an array containing both matching and non-matching elements

I'm looking to separate a string into an array made up of consecutive substrings, alternating between matches and non-matches of a specified regular expression. Here's an example: [nonmatch, match, nonmatch, match...] For instance, using the c ...

The event listener continues to throw an error when attempting to play audio

I'm encountering an issue with triggering audio in my window's load listener function. var audio = new Audio(); audio.src = "assets/silence.mp3"; audio.load(); document.getElementById("body").addEventListener( 'touchstart', functio ...

Submitting data with a checkbox and dropdown menu

Currently, I am working with a HTML table where rows are generated dynamically inside a for loop. Each row consists of a checkbox with a unique value but the same name ("checkboxes"), and at the end of each row there is a select element also with the same ...

Loop through a nested array within another nested array in mongodb

I was presented with the following data: { "_ID": "234", "sub": { "abcId": "123", "subElems": [ { "abcId": "345", "subElems": [ { "abcId": "676", "subElems": [ { ...

Effortlessly submit multiple forms at once with just a single click using the WordPress form

One issue I'm experiencing is that the forms on my site are generated using shortcodes. I have a suspicion that the buttons I created, which lead to submission form1 and then form2, may not be working properly because of this. This is the current set ...

Easily implement a "gentle" if statement check using JavaScript

When working in PHP, you can use the following code to check if a variable exists: if (@$some_var_exists) // do stuff How can you achieve a similar check in Javascript without encountering an error? Thank you UPDATE: I appreciate the responses. How ...

Error: The JSONP request encountered an unexpected token, causing a SyntaxError

Asking for data using AJAX: $.getJSON('https://www.cryptocompare.com/api/data/coinsnapshot/?fsym=BTC&tsym=USD&callback=?', function(result) { console.log(result); }); Encountering an error: "Uncaught SyntaxError: Unexpected token :" ...

Lack of Synchronization in JavaScript Dates

When receiving a time value from the client in epoch format (milliseconds since Jan 1 1970) on my node server, I convert it using the Date() object and display it as follows: var d = new Date(epochTime); var year = d.getFullYear(); var mo = d.getMonth(); ...