private async Task Create() { Error = " "; var authService = dr.GetService <IAuthService>(); var registered = await authService.Register(Name, Email, Password); if (!registered) { Logger.Value.Error("Registration has failed"); Error = @"Something went wrong. Please try again."; return; } var authenticated = await authService.Login(Email, Password); if (!authenticated) { Logger.Value.Error("Login has failed. Redirecting to login page"); // ki. NavigationState.NavigateAndReset(new RecoverPasswordViewModel(dr)); return; } NavigationState.NavigateAndReset(new WebViewModel("test_page.htm", dr)); }
private async Task Recover() { Error = " "; var ok = await authService.Recover(Email); if (!ok) { Logger.Value.Debug("Password recovery failed"); Error = "Something went wrong. Please try again."; return; } NavigationState.NavigateAndReset(new LoginViewModel(dr, "We have sent you an email with a password reset link. Please reset the password and come back to the app to log in.")); }
private void Create() { NavigationState.NavigateAndReset(new CreateProfileViewModel(dr)); }
private void Recover() { NavigationState.NavigateAndReset(new RecoverPasswordViewModel(dr)); }
private void Login() { NavigationState.NavigateAndReset(new LoginViewModel(dr)); }