Display the right endpoint in the warning in case of error
authorKevin Ottens <kevin.ottens@enioka.com>
Tue, 5 Oct 2021 21:13:27 +0000 (23:13 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Wed, 6 Oct 2021 10:17:38 +0000 (10:17 +0000)
At that point in time _pollEndpoint isn't set yet. All the checks are
against pollEndpoint so display that one in the warning. Otherwise one
always end up with an empty URL in the logs which is not very useful for
debugging purposes.

Signed-off-by: Kevin Ottens <kevin.ottens@enioka.com>
src/gui/creds/flow2auth.cpp

index b94de0afd858f07806e9abfebcfe5ca86103ec18..54b7b28a816b52a4b46e8735a0a6dac2288c3b64 100644 (file)
@@ -100,7 +100,7 @@ void Flow2Auth::fetchNewToken(const TokenAction action)
             pollToken = json.value("poll").toObject().value("token").toString();
             pollEndpoint = json.value("poll").toObject().value("endpoint").toString();
             if (_enforceHttps && QUrl(pollEndpoint).scheme() != QStringLiteral("https")) {
-                qCWarning(lcFlow2auth) << "Can not poll endpoint because the returned url" << _pollEndpoint << "does not start with https";
+                qCWarning(lcFlow2auth) << "Can not poll endpoint because the returned url" << pollEndpoint << "does not start with https";
                 emit result(Error, tr("The polling URL does not start with HTTPS despite the login URL started with HTTPS. Login will not be possible because this might be a security issue. Please contact your administrator."));
                 return;
             }