From 542fd6c6ca346c2b3b0dbc421489e57e203de91b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 25 Jul 2025 13:51:32 -1000 Subject: [PATCH] fixes --- esphome/components/api/api_connection.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 76713c54c8..6517f9fa1f 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1407,21 +1407,19 @@ bool APIConnection::send_hello_response(const HelloRequest &msg) { return this->send_message(resp, HelloResponse::MESSAGE_TYPE); } -bool APIConnection::send_connect_response(const ConnectRequest &msg) { - bool correct = true; #ifdef USE_API_PASSWORD - correct = this->parent_->check_password(msg.password); -#endif +bool APIConnection::send_connect_response(const ConnectRequest &msg) { + bool correct = this->parent_->check_password(msg.password); ConnectResponse resp; // bool invalid_password = 1; resp.invalid_password = !correct; - if (correct) { + if (this->parent_->check_password(msg.password)) { this->complete_authentication_(); } return this->send_message(resp, ConnectResponse::MESSAGE_TYPE); } - +#endif // USE_API_PASSWORD bool APIConnection::send_ping_response(const PingRequest &msg) { PingResponse resp; return this->send_message(resp, PingResponse::MESSAGE_TYPE);