Unable to create a user on the server with Accounts.createUser()


#1

Hi

I have a very simple Meteor method which I call from the client

Meteor.methods({
    createUserEx(options) {
        const user = Accounts.createUser(options);
        return user;
    }
});

I pass the options object, like {email: 'me@mail.com', password: 'secure') .

Problem I have that the call to Accounts.createUser always fails with a message ‘User not found [403]’

I tried to debug, at it seems that the password hashing fails in accounts-password package (the bcryptHash line fails)

var hashPassword = function (password) {
  password = getPasswordString(password);
  return bcryptHash(password, Accounts._bcryptRounds());
};

I tried this on mac and windows also with nodejs v.8 and v.9. The error is the same.

I tried the bcrypt version which comes with accounts-password (npm-bcrypt). Also tried to use the latest bcrypt with meteor npm i bcrypt. Nothing helped.

When I call Accounts.createUser from the client, it works fine.

What might be a problem? Please help

Thanks

Darius


#2

Docs say the callback is client only

Haven’t tested but would review there