public IHttpActionResult UpdateUserPassword(string password, string passwordConfirm)
        {
            if (string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(passwordConfirm))
            {
                return(BadRequest(Resources.EmptyPassword));
            }

            try
            {
                _ipersonaldata.ChangePasswordData(User.GetUserId(), password, passwordConfirm);
            }
            catch (ValidationException exception)
            {
                return(BadRequest(exception.Message));
            }

            return(new StatusCodeResult(HttpStatusCode.NoContent, Request));
        }
Beispiel #2
0
        public IHttpActionResult UpdateUserPassword(string password, string passwordConfirm) //  TODO: где старый пароль?? если это ресет пароля то нужен токен из письма
        {
            if (string.IsNullOrWhiteSpace(password) || string.IsNullOrWhiteSpace(passwordConfirm))
            {
                return(BadRequest(Resources.EmptyPassword));
            }

            try
            {
                _ipersonaldata.ChangePasswordData(User.GetUserId(), password, passwordConfirm);
            }
            catch (ValidationException exception)
            {
                return(BadRequest(exception.Message));
            }

            return(new StatusCodeResult(HttpStatusCode.NoContent, Request));
        }