Start a new topic

Username Existence Check

there is a function for Username Existence Check



http://devcenter.kinvey.com/html5/guides/users#userexists



is there a function for Email Existence Check ?



username and email should be automatically check for User collection when signup since these 2 field cannot be duplicated.

User Discovery need us to be login first. When a user signup an account with your service, there is no login.



I have made a HOOK for onPreSave. Problem solved



function onPreSave(request, response, modules) {



modules.collectionAccess.collection('user').findOne({"email": request.body.email}, function (err, doc) {



if (err) {



response.body = {error: err.message};



response.complete(400);



} else {



if(doc) {



response.body = {error: "You have already signed up with this email"};



response.complete(400);



} else {



response.continue();



}



}



});



}
Hi, have you considered using User Discovery instead? http://devcenter.kinvey.com/html5/guides/users#lookup
Login or Signup to post a comment