Пример #1
0
        public void LoginUser(object Sender, EventArgs e)
        {
            string code = verificationCodeInput.Text;

            if (code == Token)
            {
                var       r       = new RestService();
                LogInBody tijelo  = new LogInBody(PhoneID, PhoneNumber, code);
                Uri       restUri = new Uri(Constants.RestURLBearerToken);
                App.btoken           = Task.Run(async() => { return(await r.AuthentificateAsync(restUri, tijelo)); }).Result;
                Settings.BearerToken = JsonConvert.SerializeObject(App.btoken);
                CrudApi api = new CrudApi(App.btoken);
                if (App.btoken.Access_token != "")
                {
                    Navigation.PushModalAsync(new NavigationPage(new AddAttendance()));
                }
            }
            else
            {
                DisplayAlert("Verification failed", "You entered invalid code.", "OK");
            }
        }