public override async Task InitAsync() { await AuthManager.LoadAsync(); if (AuthManager.IsAuthenticated) { if (EntityHeader.IsNullOrEmpty(AuthManager.User.CurrentOrganization)) { Logger.AddKVPs(new KeyValuePair <string, string>("Email", AuthManager.User.Email)); } else { Logger.AddKVPs(new KeyValuePair <string, string>("Email", AuthManager.User.Email), new KeyValuePair <string, string>("OrgId", AuthManager.User.CurrentOrganization.Text)); } if (!AuthManager.User.EmailConfirmed || !AuthManager.User.PhoneNumberConfirmed) { await ViewModelNavigation.SetAsNewRootAsync <VerifyUserViewModel>(); } else if (EntityHeader.IsNullOrEmpty(AuthManager.User.CurrentOrganization)) { await ViewModelNavigation.SetAsNewRootAsync <Orgs.OrgEditorViewModel>(); } else { await ViewModelNavigation.SetAsNewRootAsync(_clientAppInfo.MainViewModel); } } else { NotLoggedIn = true; IsLoading = false; } }
public async void LoginAsync() { var loginResult = await PerformNetworkOperation(PerformLoginAsync); if (loginResult.Successful) { if (AuthManager.User.EmailConfirmed && AuthManager.User.PhoneNumberConfirmed) { // If no org, have them add an org.... if (EntityHeader.IsNullOrEmpty(AuthManager.User.CurrentOrganization)) { await ViewModelNavigation.SetAsNewRootAsync <OrgEditorViewModel>(); } else { // We are good, so show main screen. await ViewModelNavigation.SetAsNewRootAsync(_clientAppInfo.MainViewModel); } } else { // Show verify user screen. await ViewModelNavigation.SetAsNewRootAsync <VerifyUserViewModel>(); } } }
public override void Save() { base.Save(); if (FormAdapter.Validate()) { ViewToModel(FormAdapter, Model); PerformNetworkOperation(async() => { await ViewModelNavigation.SetAsNewRootAsync(_clientAppInfo.MainViewModel); }); } }
public async Task TransitionToNextView() { if (AuthManager.User.EmailConfirmed && AuthManager.User.PhoneNumberConfirmed) { if (EntityHeader.IsNullOrEmpty(AuthManager.User.CurrentOrganization)) { await ViewModelNavigation.SetAsNewRootAsync <OrgEditorViewModel>(); } else { await ViewModelNavigation.SetAsNewRootAsync(_clientAppInfo.MainViewModel); } } }
public async void Logout() { await AuthManager.LogoutAsync(); await ViewModelNavigation.SetAsNewRootAsync <Auth.LoginViewModel>(); }
public override Task PostSaveAsync() { return(ViewModelNavigation.SetAsNewRootAsync(_clientAppInfo.MainViewModel)); }
public async void Login() { await ViewModelNavigation.SetAsNewRootAsync <Auth.LoginViewModel>(); }