mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

more control over createUser and loginWithPassword #102

Open lokat opened 8 years ago

lokat commented 8 years ago

Hi,

I can see that createUser and loginWithPassword passing options to meteor accounts using a defined options parameter

var options = {
        password: password,
        user: {
            username: username,
            email: email
        }
    };

where as from the meteor accounts, the options should be

{username: string, email: string, password: string, profile: {object}}

as been stated at http://docs.meteor.com/api/passwords.html#Accounts-createUser

infacq commented 8 years ago

+1

dukye commented 7 years ago

+1 I have a bug on createUser using version 2.0.3 "Need to set a username or email [400]" due to malformatted object like previously wrote.

johhansantana commented 7 years ago

I'm getting error when trying to createUser as well

const options = {
  email: 'testing@test.com',
  password: 'testing123'
};
asteroid.createUser(options, (err, res) => {
  console.log('err: ', err);
  console.log('res: ', res);
});
{
  "error": 400,
  "reason": "Need to set a username or email",
  "message": "Need to set a username or email [400]",
  "errorType": "Meteor.Error"
}
infacq commented 7 years ago

I suggest you use native meteor createUser by calling it like this

asteroid.call('createUser', options)
elmarti commented 6 years ago

Is this likely to be fixed any time soon? I can jump on it if you like. image Current work arround is to call the createUser directly