0
votes

This Meteor app has the insecure and autopublish removed and accounts-ui accounts-password added.
I am able to register a new user but how can I modify the app so that a user can send the username and password then my app invokes isUserExist and if true is returned, then the app logs this user in? Thanks

//client/login.html
<template name="login">
  {{> loginButtons}}
</template>

//client/login.js
Accounts.ui.config({
  passwordSignupFields: "USERNAME_ONLY"
});

//server.js
Meteor.methods({
  isUserExist: function (username, password) {
   //do work
  return true; //or false
 }
});
1
Does this help? - MasterAM

1 Answers

0
votes

You will have to add the user document directly to the database, with the pre-issued username and password. For this, you can either

  1. build a new flow for the admin user (whoever will be creating those user-ids) to create the users, or
  2. Insert the user details into the MongoDB database directly. This is not usually recommended because there might be dependencies / validations that you might miss, but it should work.