mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-18 18:51:40 +02:00
Add "General.GetRPCCommands" RPC command
This commit is contained in:
parent
9570018cf4
commit
a72c6948b1
7 changed files with 106 additions and 20 deletions
|
@ -145,7 +145,7 @@ void Server::processRequest(const jsonrpcpp::request_ptr& request, AuthInfo& aut
|
|||
else
|
||||
{
|
||||
std::optional<jsonrpcpp::RequestException> e;
|
||||
if (!authinfo.hasAuthInfo())
|
||||
if (!authinfo.isAuthenticated())
|
||||
e.emplace(jsonrpcpp::Error("Unauthorized", 401), request->id());
|
||||
else
|
||||
e.emplace(jsonrpcpp::Error("Forbidden", 403), request->id());
|
||||
|
@ -204,7 +204,7 @@ void Server::onMessageReceived(std::shared_ptr<ControlSession> controlSession, c
|
|||
processRequest(request, controlSession->authinfo,
|
||||
[this, controlSession, response_handler](const jsonrpcpp::entity_ptr& response, const jsonrpcpp::notification_ptr& notification)
|
||||
{
|
||||
// if (controlSession->authinfo.hasAuthInfo())
|
||||
// if (controlSession->authinfo.isAuthenticated())
|
||||
// {
|
||||
// LOG(INFO, LOG_TAG) << "Request auth info - username: " << controlSession->authinfo->username()
|
||||
// << ", valid: " << controlSession->authinfo->valid() << "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue