How to check if username or email has been taken already? [Using Parse]
Hi everyone.
Sorry if my english is not good enough...
I'm developing a Login and SignUp display using Parse... this is my first time using something related to databases or servers.
I've done the sign up button works if the username and email aren't register in my parse plattform, and the loggin button works if the password and username exists in the plattform and they match. But if something is wrong whit it, How can I know if the username is registered or the password is wrong?
here is the documentation of Parse:
https://parse.com/docs/unity/guide#users
And here is my code for Login:
public void LogIn()
{
ParseUser.LogInAsync (usuario.text, contrasenia.text).ContinueWith (t =>
{
if (t.IsFaulted || t.IsCanceled) {
//login Failed
print ("FAILED LOGIN");
}
else {
//Login was Succesful
print ("LOGIN SUCCESS");
}
});}
And here is my code for SignUp:
using UnityEngine;
using System.Collections;
using Parse;
using System.Threading.Tasks;
public class AddUserTEST : MonoBehaviour {
private ParseUser user;
void Start(){
}
void SuscribirUsuario(){
user = new ParseUser ()
{
Username = "exampleUsername",
Password = "examplePassword",
Email = "mailExample@hotmail.com"
};
user["Nivel"] = "1";
Task signUpTask = user.SignUpAsync () ;
}
void Update(){
if(Input.GetKeyDown(KeyCode.Space)){
SuscribirUsuario();
}
}
}
Thanks everyone... :)
Your answer
Follow this Question
Related Questions
Need help please - Google Play Game Services stalls and fails immediately 0 Answers
Unity Hub is signed in, but not Unity 0 Answers
Windows 10 Unity Launcher Bugs at Sign In window 0 Answers
Major Account Issue 0 Answers
login system in unity w/ SQLite 0 Answers