public async Task Login() { try { ErrorMessage = ""; var result = await _apiHelper.Authenticate(UserName, Password); User = await _apiHelper.GetUserInfo(result.access_token); User.access_token = result.access_token; Console.WriteLine(Event.Name); } catch (Exception ex) { ErrorMessage = ex.Message; } }
public async Task LogIn() { try { //Clear error message when the user clicks login button ErrorMessage = ""; //Try to connect to api var result = await _apiHelper.Authenticate(UserName, Password); //Capture more information about the user await _apiHelper.GetUserInfo(result.Id, result.Access_Token); //Raise an even that someone logged in _events.PublishOnUIThread(new LogOnEvent()); } catch (Exception ex) { ErrorMessage = ex.Message; } }