Esempio n. 1
0
        public ResetJarsUserPasswordResponse Any(ResetJarsUserPassword request)
        {
            var             res        = new ResetJarsUserPasswordResponse();
            IAuthRepository ssAuthRepo = ServiceStackHost.Instance.GetAuthRepository();
            IUserAuth       ssUser     = ssAuthRepo.GetUserAuthByUserName(request.EmailOrUserName);

            if (ssUser == null)
            {
                throw HttpError.NotFound("User not found");
            }

            return(res);
        }
Esempio n. 2
0
        private void btnResetPassword_Click(object sender, EventArgs e)
        {
            ResetJarsUserPasswordResponse response = GlobalContext.Instance.AuthClient.Post(new ResetJarsUserPassword()
            {
                EmailOrUserName = txtResetEmail.Text,
                ResetToken      = txtResetToken.Text,
                NewPassword     = txtResetPasswordConfirm.Text
            });

            if (response.ResetSuccess)
            {
                MessageBox.Show("Password reset success, please log in with new password.");
                BtnSwitchToLogin_Click(null, null);
            }
        }