def allow_or_reject
      # We assume the the rejection action is going to be on the public controller
      # since we wouldn't want to forward the rejection to the handcart
      my_rejection_url = main_app.url_for({
        # subdomain: '',
        host: Handcart::DomainConstraint.default_constraint.domain,
        controller: @rejection_url.split("#").first,
        action: @rejection_url.split("#").last,
        trailing_slash: false,
      })

      # See if they have enable IP blocking if they respond to that.
      if current_handcart.respond_to?(:enable_ip_blocking?)
        truthiness = current_handcart.enable_ip_blocking?
      else
        # Default to true
        truthiness = true
      end

      if truthiness
        ip_address = current_handcart.ip_addresses.permitted.find_by_address(request.remote_ip)
        if ip_address
          if Handcart.ip_authorization.strategy.is_in_range?(ip_address.address, current_handcart)
            # Do nothing, let them login
          else
            # # The strategy doesn't match
            redirect_to my_rejection_url
          end
        else
          # No IP Address was found
          redirect_to my_rejection_url
        end
      else
        # Do nothing, blocking mode is disabled
      end
    end
def allow_or_reject
      # We assume the the rejection action is going to be on the public controller
      # since we wouldn't want to forward the rejection to the handcart
      my_rejection_url = main_app.url_for({
        # subdomain: '',
        host: Handcart::DomainConstraint.default_constraint.domain,
        controller: @rejection_url.split("#").first,
        action: @rejection_url.split("#").last,
        trailing_slash: false,
      })

      # See if they have enable IP blocking if they respond to that.
      if current_handcart.respond_to?(:enable_ip_blocking?)
        truthiness = current_handcart.enable_ip_blocking?
      else
        # Default to true
        truthiness = true
      end

      if truthiness
        ip_address = current_handcart.ip_addresses.permitted.find_by_address(request.remote_ip)
        if ip_address
          if Handcart.ip_authorization.strategy.is_in_range?(ip_address.address, current_handcart)
            # Do nothing, let them login
          else
            # # The strategy doesn't match
            redirect_to my_rejection_url
          end
        else
          # No IP Address was found
          redirect_to my_rejection_url
        end
      else
        # Do nothing, blocking mode is disabled
      end
    end
Don't allow unauthorized or blacklisted foreign IP addresses to hit
 what we assume is the session controller for the franchisee.