Display the right endpoint in the warning in case of error

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>
This commit is contained in:
Kevin Ottens 2021-10-05 23:13:27 +02:00 committed by Kevin Ottens (Rebase PR Action)
parent 820ca38270
commit 5fe63a4d9a

View 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;
}