mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
Inform AccountManager about metaverse server change
This commit is contained in:
parent
bf48bf01c6
commit
30806ce346
5 changed files with 21 additions and 1 deletions
|
@ -407,7 +407,11 @@ Item {
|
|||
var url = metaverseServerField.text;
|
||||
console.log("Setting metaverse server to", url);
|
||||
Settings.setValue("private/selectedMetaverseURL", url);
|
||||
setAuthURL(url);
|
||||
//setAuthURL(url);
|
||||
if(AccountServices.isLoggedIn()){
|
||||
AccountServices.logOut();
|
||||
}
|
||||
AccountServices.updateAuthURLFromMetaverseServerURL();
|
||||
}
|
||||
linkAccountBody.login();
|
||||
break;
|
||||
|
|
|
@ -72,6 +72,11 @@ void AccountServicesScriptingInterface::logOut() {
|
|||
return accountManager->logout();
|
||||
}
|
||||
|
||||
void AccountServicesScriptingInterface::updateAuthURLFromMetaverseServerURL() {
|
||||
auto accountManager = DependencyManager::get<AccountManager>();
|
||||
return accountManager->updateAuthURLFromMetaverseServerURL();
|
||||
}
|
||||
|
||||
void AccountServicesScriptingInterface::loggedOut() {
|
||||
emit AccountServicesScriptingInterface::disconnected(QString("logout"));
|
||||
}
|
||||
|
|
|
@ -192,6 +192,12 @@ public slots:
|
|||
* @function AccountServices.logOut
|
||||
*/
|
||||
void logOut();
|
||||
|
||||
/*@jsdoc
|
||||
* Updates Metaverse Server URL in AccountManager. It's called by Login window after Metaverse Server URL is changed.
|
||||
* @function AccountServices.updateAuthURLFromMetaverseServerURL
|
||||
*/
|
||||
void updateAuthURLFromMetaverseServerURL();
|
||||
|
||||
private slots:
|
||||
void loggedOut();
|
||||
|
|
|
@ -205,6 +205,10 @@ void AccountManager::setAuthURL(const QUrl& authURL) {
|
|||
}
|
||||
}
|
||||
|
||||
void AccountManager::updateAuthURLFromMetaverseServerURL() {
|
||||
setAuthURL(MetaverseAPI::getCurrentMetaverseServerURL());
|
||||
}
|
||||
|
||||
void AccountManager::setSessionID(const QUuid& sessionID) {
|
||||
if (_sessionID != sessionID) {
|
||||
qCDebug(networking) << "Metaverse session ID changed to" << uuidStringWithoutCurlyBraces(sessionID);
|
||||
|
|
|
@ -79,6 +79,7 @@ public:
|
|||
const QUrl& getAuthURL() const { return _authURL; }
|
||||
void setAuthURL(const QUrl& authURL);
|
||||
bool hasAuthEndpoint() { return !_authURL.isEmpty(); }
|
||||
Q_INVOKABLE void updateAuthURLFromMetaverseServerURL();
|
||||
|
||||
bool isLoggedIn() { return !_authURL.isEmpty() && hasValidAccessToken(); }
|
||||
bool hasValidAccessToken();
|
||||
|
|
Loading…
Reference in a new issue