private async void TryLogin(bool goToEmail) { try { if (userModel == null) { return; } IsBusy = true; var result = await authenticationService.LoginAsync(userModel.Email, userModel.Password); if (result.IsSuccess) { if (!string.IsNullOrWhiteSpace(result.Jwt.AuthToken)) { Settings.ClearSettings(); Settings.Token = result.Jwt.AuthToken; Settings.UserName = result.Jwt.UserName; Settings.UserProfileImage = userModel.UserProfileImage; Settings.UserID = result.Jwt.ID; requestProvider.InitWithAuthorizationToken(result.Jwt.AuthToken); NavigationService.IsCompany = await authenticationService.GetIsCompany(); } IsBusy = false; await NavigationService.NavigateToAsync <MainViewModel>(); NavigationService.ClearBackStack(); } else { if (!goToEmail || !platformService.GoToInbox()) { await NavigationService.DisplayAlert("Error", "Please check your email and confirm registration", "Ok"); } } } catch (Exception ex) { await NavigationService.DisplayAlert("Error", ex.Message, "Ok"); } finally { IsBusy = false; } }