mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 06:03:26 +02:00
Make XMLHttpRequest automatically authorize API calls
This commit is contained in:
parent
573ce7261b
commit
83a868d741
1 changed files with 4 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <NetworkAccessManager.h>
|
||||
|
||||
#include <AccountManager.h>
|
||||
#include "XMLHttpRequestClass.h"
|
||||
#include "ScriptEngine.h"
|
||||
|
||||
|
@ -201,6 +202,9 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a
|
|||
notImplemented();
|
||||
}
|
||||
} else {
|
||||
if (url.toLower().left(33) == "https://data.highfidelity.io/api/") {
|
||||
_url.setQuery("access_token=" + AccountManager::getInstance().getAccountInfo().getAccessToken().token);
|
||||
}
|
||||
if (!username.isEmpty()) {
|
||||
_url.setUserName(username);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue