private async void ExecuteLogin() { try { CanExecuteInitial(); await NavigationHelper.ShowLoading(); var response = await _userAppService.Login(new LoginRequest() { Email = Login, Origin = 0, Password = Password }); if (response != null && response.User != null) { await CacheAccess.InsertSecure <User>(CacheKeys.USER_KEY, response.User); await CacheAccess.InsertSecure <Guid>(CacheKeys.ACCESS_TOKEN, response.Token); Settings.AccessToken = response.Token.ToString(); Settings.UserId = response.User.UsuarioId.ToString(); await _navigationService.NavigateAsync(NavigationSettings.MenuPrincipal); try { Analytics.TrackEvent(InsightsTypeEvents.ActionView, new Dictionary <string, string> { { InsightsPagesNames.LoginPage, InsightsActionNames.LoginSuccess } }); } catch { } var teste2 = await _salesAppService.GetUserSalePointsForChallenge(response.User.UsuarioId.ToString()); var teste3 = await _clientsAppService.GetUserClientPointsForChallenge(response.User.UsuarioId.ToString()); } else { TimeSpan duration = new TimeSpan(0, 0, 2); _userDialogs.Toast("Login ou senha incorretos"); throw new Exception("Ocorreu um erro, tente novamente mais tarde."); } } catch (Exception ex) { Analytics.TrackEvent(InsightsTypeEvents.ActionView, new Dictionary <string, string> { { InsightsPagesNames.LoginPage, InsightsActionNames.LoginFailed } }); UserDialogs.Instance.Toast("Não foi possível fazer o Login, verifique sua conexão"); } finally { await NavigationHelper.PopLoading(); CanExecuteEnd(); } }