Start a new topic

User signup with email and username

Hi there,



It is kind of weird that when creating a user, I can't save email and username at the same time:



AsyncUser asyncUser = mKinveyClient().user();



asyncUser.put("email", email);



asyncUser.create(username, password, new KinveyUserCallback() {



public void onFailure(Throwable t) {

Log.i("failed","");

}



public void onSuccess(User u) {



Log.i("success","");



}



});



The email field is empty at backend. Any clue?



Cheers,

Mark

Hey there Mark,



This is actually a bug with our library. I have notified the library developer about it and we should be pushing out a fix for this pretty soon. I will update this thread with more information when it becomes available on either a fix or a workaround until we determine a fix.



Thanks for your report,



Mark,

just an update, this has been fixed in a release to the Java library. It is available for download here it is version 2.6.17: http://devcenter.kinvey.com/java/downloads .



Please let us know if you find anything else,



Damien
ok thanks Damien. I will try it out and update here
yes it is working now. before "create" user, I "put" email and it save in Users collection. However, I am wondering anywhere to make the email field unique? When I "create" a user with email already existed, it still saved into Users collection.
Mark, it's really funny that you mention this as it's a discussion that we were having internally just last week.



What you can do is in your mongodb query do an exists or nin query (through Business Logic would be the easiest way)



http://docs.mongodb.org/manual/reference/operator/query/exists/

http://docs.mongodb.org/manual/reference/operator/query/nin/#op._S_nin



Please let me know if you need anymore help.
I am sorry to ask this stupid question since it can be done using business logic.



Cheerios,

Mark
No worries, are you comfortable implementing it using business logic?



Thanks,
Yeah I have been implementing a few business logic.



Cheerios,

Mark
Login or Signup to post a comment