Hi,
I want to test if a user exists in the Tiggzi database using username and not _id can I do this as you would do from other collections?
Regards,
Joe
Hi,
I want to test if a user exists in the Tiggzi database using username and not _id can I do this as you would do from other collections?
Regards,
Joe
Hi,
Do you understand my question? I want to test if a user already has an account by querying the users table using the username as a parameter and if no record exists then add a record.
I am able to add a record and if I attempt to duplicate an existing user I get an 400 Bad Request error returned. But if I try to query the uses table I get a 401 authentication error. How do I get the users returned? Or do I simply use the error as an indication that the record already exists.
Regards,
joe
Hi Joe,
To check if user exists in database you can test HTTP Status for login service.
Error = 400 - User exists but password is incorrect
Error = 404 - User doesn't exist
You can get error code via JavaScript added to "Error" action for login service:
codeif (jqXHR.status == 404) {
alert("No such user!");
}
else if(jqXHR.status == 400) {
alert("Invalild password");
}/code
Thanks Katya I will give it a go.