Once the user submits the login info, and presses login button the following method is called;
public Page OnLogInButtonClicked (string email, string password)
{
var client = new RestClient("http://babyAPI.com");
var request = new RestRequest("api/ApiKey?email=" + email + "&password=" + password, Method.GET);
var queryResult = client.Execute(request);
if (queryResult.StatusCode == HttpStatusCode.OK)
{
var deserial = new JsonDeserializer();
var x = deserial.Deserialize<ApiKey>(queryResult);
return ;
}
else
{
return ;
}
}
Is this the correct way to do it? And if the user is authenticated, I need to navigate to a new page, else show authentication failed. How can that be done?