mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 04:58:08 +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 <NetworkAccessManager.h>
|
||||||
|
|
||||||
|
#include <AccountManager.h>
|
||||||
#include "XMLHttpRequestClass.h"
|
#include "XMLHttpRequestClass.h"
|
||||||
#include "ScriptEngine.h"
|
#include "ScriptEngine.h"
|
||||||
|
|
||||||
|
@ -201,6 +202,9 @@ void XMLHttpRequestClass::open(const QString& method, const QString& url, bool a
|
||||||
notImplemented();
|
notImplemented();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (url.toLower().left(33) == "https://data.highfidelity.io/api/") {
|
||||||
|
_url.setQuery("access_token=" + AccountManager::getInstance().getAccountInfo().getAccessToken().token);
|
||||||
|
}
|
||||||
if (!username.isEmpty()) {
|
if (!username.isEmpty()) {
|
||||||
_url.setUserName(username);
|
_url.setUserName(username);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue