コード例 #1
0
        private async Task <bool> PostLogin()
        {
            var loginService = new WebAPIHelper("api/korisnici/login/");
            var auth         = new AuthVM()
            {
                Email    = entryEmail.Text,
                Password = entryPassword.Text
            };

            var response = await loginService.PostResponse(auth);

            if (response.IsSuccessStatusCode)
            {
                var korisnik = WebAPIHelper.GetResponseContent <VerifikovanKorisnikVM>(response);
                ApplicationProperties.UserToken  = korisnik.Token;
                ApplicationProperties.KorisnikId = korisnik.Id.ToString();
                ApplicationProperties.userRole   = (int)korisnik.isUserRole;
                return(true);
            }

            return(false);
        }