diff options
Diffstat (limited to 'src/ext_distribution.cpp')
| -rw-r--r-- | src/ext_distribution.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/ext_distribution.cpp b/src/ext_distribution.cpp index 42f4156..81039bb 100644 --- a/src/ext_distribution.cpp +++ b/src/ext_distribution.cpp @@ -1,6 +1,3 @@ -// Copyright 2026 Osmium Sorcerer -// SPDX-License-Identifier: MIT - #include "ext_packet.h" #include "aoapplication.h" @@ -11,11 +8,10 @@ #include <QHeaderView> #include <QVBoxLayout> -static void handleAuthChallenge(QByteArrayView body, AOApplication *ao) +static void handleAuthChallenge(QByteArrayView body, AuthFlow *auth) { - if (ao->ex_auth_username.isEmpty()) + if (!auth->awaiting_challenge()) { - // We're not authenticating, ignore. return; } @@ -26,7 +22,7 @@ static void handleAuthChallenge(QByteArrayView body, AOApplication *ao) return; } - new AuthFlow(ao, challenge); + auth->respond(challenge); } void AOApplication::ex_message_received(QByteArrayView message) @@ -36,7 +32,7 @@ void AOApplication::ex_message_received(QByteArrayView message) switch (type) { case ExMsgType::auth_challenge: - handleAuthChallenge(body, this); + handleAuthChallenge(body, &this->auth); break; default: qWarning() << "Unknown message type:" << (int)type; |
