コード例 #1
0
        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));
        }
コード例 #2
0
        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."));
        }
コード例 #3
0
 private void Create()
 {
     NavigationState.NavigateAndReset(new CreateProfileViewModel(dr));
 }
コード例 #4
0
 private void Recover()
 {
     NavigationState.NavigateAndReset(new RecoverPasswordViewModel(dr));
 }
コード例 #5
0
 private void Login()
 {
     NavigationState.NavigateAndReset(new LoginViewModel(dr));
 }