def authenticate_publish(message)
      if CisRailsChat.config[:secret_token].nil?
        raise Error, "No secret_token config set, ensure cis_rails_chat.yml is loaded properly."
      elsif message["ext"]["cis_rails_chat_token"] != CisRailsChat.config[:secret_token]
        message["error"] = "Incorrect token."
      else
        message["ext"]["cis_rails_chat_token"] = nil
      end
    end
def authenticate_publish(message)
      if CisRailsChat.config[:secret_token].nil?
        raise Error, "No secret_token config set, ensure cis_rails_chat.yml is loaded properly."
      elsif message["ext"]["cis_rails_chat_token"] != CisRailsChat.config[:secret_token]
        message["error"] = "Incorrect token."
      else
        message["ext"]["cis_rails_chat_token"] = nil
      end
    end
Ensures the secret token is correct before publishing.