Start a new topic

Kinvey.Error: user argument must contain: id and authtoken.

Hi, I'm using EmberJS and trying to create a generic signup form.



If I do this in my login controller, it works fine:



signup: function(username, password, email) {



var newuser = this.store.createRecord('user', {

username: username,

password: password,

email: email

});

var promise = newuser.save();

promise.then(function(user) {

console.log("Promise successful, returning user:");

console.log(user);

});

}



However, if I use the syntax suggested in the documentation (http://devcenter.kinvey.com/ember/guides/users#signup) I get this error: "Assertion Failed: Kinvey.Error: user argument must contain: id and authtoken."



Here's the code that fails:



signup: function(username, password, email) {



var promise = Kinvey.User.signup({

username: username,

password: password,

email: email

});

promise.then(function(user) {

console.log("Promise successful, returning user:");

console.log(user);

});

}



Seems like the difference is the use of "Kinvey.User" but I believe my initializer and adapter is working properly, since I see the user created in the Kinvey User database when I use the first approach.



Any ideas?

Actually I switched over to Angular. Too many challenges with Ember-cli, I think I need to wait for it to hit 1.0 and come back to it. Thx for your help.
It might, I have not tried using the Ember-cli. How does your applications initializers look like?
Yes, in fact I just checked and the user actually gets created on in the Kinvey user store. Just getting that odd error.



Also I should have mentioned I'm using Ember-cli, which I'm guessing has something to do with it.
Can you see if the network request is actually made when you try the second approach? It looks right, but something might be going wrong internally.
Login or Signup to post a comment