Showing the changes to libraries/script-engine/src/XMLHttpRequestClass.cpp (1 of 1 file). Show all
Unified · Split
| @@ -14,6 +14,7 @@ · 13 unmodified lines | |||
| 14 | 14 | ||
| 15 | #include <QEventLoop> | 15 | #include <QEventLoop> |
| 16 | #include <QFile> | 16 | #include <QFile> |
| 17 | #include <qurlquery.h> | ||
| 17 | 18 | ||
| 18 | #include <NetworkAccessManager.h> | 19 | #include <NetworkAccessManager.h> |
| 19 | 20 | ||
| @@ -207,7 +208,14 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a · 187 unmodified lines | |||
| 207 | } | 208 | } |
| 208 | } else { | 209 | } else { |
| 209 | if (url.toLower().left(33) == "https://data.highfidelity.io/api/") { | 210 | if (url.toLower().left(33) == "https://data.highfidelity.io/api/") { |
| 210 | _url.setQuery("access_token=" + AccountManager::getInstance().getAccountInfo().getAccessToken().token); | 211 | AccountManager& accountManager = AccountManager::getInstance(); |
| 212 | |||
| 213 | if (accountManager.hasValidAccessToken()) { | ||
| 214 | QUrlQuery urlQuery(_url.query()); | ||
| 215 | urlQuery.addQueryItem("access_token", accountManager.getAccountInfo().getAccessToken().token); | ||
| 216 | _url.setQuery(urlQuery); | ||
| 217 | } | ||
| 218 | |||
| 211 | } | 219 | } |
| 212 | if (!username.isEmpty()) { | 220 | if (!username.isEmpty()) { |
| 213 | _url.setUserName(username); | 221 | _url.setUserName(username); |