mirror of
https://github.com/anope/anope.git
synced 2026-06-30 17:26:39 +02:00
Also allow hashed RPC tokens in the config file.
This commit is contained in:
@@ -281,12 +281,14 @@ public:
|
||||
for (int i = 0; i < modconf.CountBlock("token"); ++i)
|
||||
{
|
||||
const auto &block = modconf.GetBlock("token", i);
|
||||
const auto &token = block.Get<const Anope::string>("token");
|
||||
if (!token.empty())
|
||||
|
||||
RPC::Token token;
|
||||
token.token = block.Get<const Anope::string>("token");
|
||||
if (!token.token.empty())
|
||||
{
|
||||
std::vector<Anope::string> methods;
|
||||
spacesepstream(block.Get<const Anope::string>("methods")).GetTokens(methods);
|
||||
jsonrpcinterface.tokens.emplace(token, methods);
|
||||
token.token_hash = block.Get<const Anope::string>("token_hash");
|
||||
spacesepstream(block.Get<const Anope::string>("methods")).GetTokens(token.methods);
|
||||
jsonrpcinterface.tokens.emplace_back(token);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user