Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Making a login method

$
0
0

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?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>