public PasswordResetRequestAuthenticationResult IsPasswordRequestValid(Controller controller, string requestId, string token, IUserAreaDefinition userAreaToLogInTo)
        {
            var result = new PasswordResetRequestAuthenticationResult();

            result.ValidationErrorMessage = "Invalid password reset request";

            if (!controller.ModelState.IsValid)
            {
                return(result);
            }

            if (string.IsNullOrWhiteSpace(requestId) || string.IsNullOrWhiteSpace(token))
            {
                AddPasswordRequestInvalidError(controller);
                return(result);
            }

            Guid requestGuid;

            if (!Guid.TryParse(requestId, out requestGuid))
            {
                AddPasswordRequestInvalidError(controller);
                return(result);
            }

            var query = new ValidatePasswordResetRequestQuery();

            query.UserPasswordResetRequestId = requestGuid;
            query.Token        = Uri.UnescapeDataString(token);
            query.UserAreaCode = userAreaToLogInTo.UserAreaCode;

            result = _queryExecutor.Execute(query);

            return(result);
        }
        private ValidatePasswordResetRequestQuery CreateValidationQuery(CompleteUserPasswordResetCommand command)
        {
            var query = new ValidatePasswordResetRequestQuery();

            query.UserPasswordResetRequestId = command.UserPasswordResetRequestId;
            query.UserAreaCode = command.UserAreaCode;
            query.Token        = command.Token;

            return(query);
        }