log network code on token response

This commit is contained in:
Martin Rotter 2021-06-30 07:28:42 +02:00
parent 9ec9c891c5
commit d07c51d831
2 changed files with 7 additions and 2 deletions

View File

@ -470,7 +470,7 @@ void Application::showGuiMessage(Notification::Event event, const QString& title
MessageBox::show(parent == nullptr ? mainFormWidget() : parent, QMessageBox::Icon(message_type), title, message);
}
else {
qDebugNN << LOGSEC_CORE << "Silencing GUI message: '" << message << "'.";
qDebugNN << LOGSEC_CORE << "Silencing GUI message:" << QUOTE_W_SPACE_DOT(message);
}
}

View File

@ -203,7 +203,7 @@ void OAuth2Service::tokenRequestFinished(QNetworkReply* network_reply) {
QJsonDocument json_document = QJsonDocument::fromJson(repl);
QJsonObject root_obj = json_document.object();
qDebugNN << LOGSEC_OAUTH << "Token response:" << QUOTE_W_SPACE_DOT(json_document.toJson());
qDebugNN << LOGSEC_OAUTH << "Token response:" << QUOTE_W_SPACE_DOT(QString::fromUtf8(json_document.toJson()));
if (network_reply->error() != QNetworkReply::NetworkError::NoError) {
qWarningNN << LOGSEC_OAUTH
@ -216,6 +216,11 @@ void OAuth2Service::tokenRequestFinished(QNetworkReply* network_reply) {
QString error = root_obj.value("error").toString();
QString error_description = root_obj.value("error_description").toString();
qWarningNN << LOGSEC_OAUTH
<< "JSON error when obtaining token response:"
<< QUOTE_W_SPACE(error)
<< QUOTE_W_SPACE_DOT(error_description);
logout();
emit tokensRetrieveError(error, error_description);