mirror of
https://github.com/overte-org/overte.git
synced 2025-08-12 00:52:59 +02:00
Improve logging for abnormal behaviour.
This commit is contained in:
parent
b9239f451f
commit
3034ce7093
1 changed files with 4 additions and 2 deletions
|
@ -696,7 +696,8 @@ void AccountManager::setAccessTokens(const QString& response) {
|
||||||
if (!rootObject.contains("access_token") || !rootObject.contains("expires_in")
|
if (!rootObject.contains("access_token") || !rootObject.contains("expires_in")
|
||||||
|| !rootObject.contains("token_type")) {
|
|| !rootObject.contains("token_type")) {
|
||||||
// TODO: error handling - malformed token response
|
// TODO: error handling - malformed token response
|
||||||
qCDebug(networking) << "Received a response for password grant that is missing one or more expected values.";
|
qCWarning(networking) << "Error setting access token. Received a response for password grant that is missing one or more expected values.";
|
||||||
|
qCWarning(networking) << "Response:" << QJsonDocument(rootObject).toJson(QJsonDocument::Compact);
|
||||||
} else {
|
} else {
|
||||||
// clear the path from the response URL so we have the right root URL for this access token
|
// clear the path from the response URL so we have the right root URL for this access token
|
||||||
QUrl rootURL = rootObject.contains("url") ? rootObject["url"].toString() : _authURL;
|
QUrl rootURL = rootObject.contains("url") ? rootObject["url"].toString() : _authURL;
|
||||||
|
@ -731,7 +732,8 @@ void AccountManager::requestAccessTokenFinished() {
|
||||||
if (!rootObject.contains("access_token") || !rootObject.contains("expires_in")
|
if (!rootObject.contains("access_token") || !rootObject.contains("expires_in")
|
||||||
|| !rootObject.contains("token_type")) {
|
|| !rootObject.contains("token_type")) {
|
||||||
// TODO: error handling - malformed token response
|
// TODO: error handling - malformed token response
|
||||||
qCDebug(networking) << "Received a response for password grant that is missing one or more expected values.";
|
qCWarning(networking) << "Error requesting access token. Received a response for password grant that is missing one or more expected values.";
|
||||||
|
qCWarning(networking) << "Response:" << QJsonDocument(rootObject).toJson(QJsonDocument::Compact);
|
||||||
} else {
|
} else {
|
||||||
// clear the path from the response URL so we have the right root URL for this access token
|
// clear the path from the response URL so we have the right root URL for this access token
|
||||||
QUrl rootURL = requestReply->url();
|
QUrl rootURL = requestReply->url();
|
||||||
|
|
Loading…
Reference in a new issue