mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 21:05:04 +02:00
if the domain-server provides no auth, assume default
This commit is contained in:
parent
b09ed1dff1
commit
1163cfd07e
2 changed files with 3 additions and 13 deletions
|
@ -96,7 +96,6 @@ Menu::Menu() :
|
||||||
// connect to the appropriate slots of the AccountManager so that we can change the Login/Logout menu item
|
// connect to the appropriate slots of the AccountManager so that we can change the Login/Logout menu item
|
||||||
connect(&accountManager, &AccountManager::loginComplete, this, &Menu::toggleLoginMenuItem);
|
connect(&accountManager, &AccountManager::loginComplete, this, &Menu::toggleLoginMenuItem);
|
||||||
connect(&accountManager, &AccountManager::logoutComplete, this, &Menu::toggleLoginMenuItem);
|
connect(&accountManager, &AccountManager::logoutComplete, this, &Menu::toggleLoginMenuItem);
|
||||||
connect(&accountManager, &AccountManager::authEndpointChanged, this, &Menu::toggleLoginMenuItem);
|
|
||||||
|
|
||||||
addDisabledActionAndSeparator(fileMenu, "Scripts");
|
addDisabledActionAndSeparator(fileMenu, "Scripts");
|
||||||
addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O, appInstance, SLOT(loadDialog()));
|
addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O, appInstance, SLOT(loadDialog()));
|
||||||
|
@ -1125,20 +1124,11 @@ void Menu::toggleLoginMenuItem() {
|
||||||
// change the menu item to logout
|
// change the menu item to logout
|
||||||
_loginAction->setText("Logout " + accountManager.getUsername());
|
_loginAction->setText("Logout " + accountManager.getUsername());
|
||||||
connect(_loginAction, &QAction::triggered, &accountManager, &AccountManager::logout);
|
connect(_loginAction, &QAction::triggered, &accountManager, &AccountManager::logout);
|
||||||
|
|
||||||
_loginAction->setEnabled(true);
|
|
||||||
} else {
|
} else {
|
||||||
// change the menu item to login
|
// change the menu item to login
|
||||||
_loginAction->setText("Login");
|
_loginAction->setText("Login");
|
||||||
|
|
||||||
// if we don't have a rootURL in the AccountManager we're in a domain that doesn't use auth
|
|
||||||
// so setup the menu item according to the presence of that root URL
|
|
||||||
if (accountManager.hasAuthEndpoint()) {
|
|
||||||
connect(_loginAction, &QAction::triggered, this, &Menu::loginForCurrentDomain);
|
connect(_loginAction, &QAction::triggered, this, &Menu::loginForCurrentDomain);
|
||||||
_loginAction->setEnabled(true);
|
|
||||||
} else {
|
|
||||||
_loginAction->setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,8 +119,8 @@ bool NodeList::packetVersionAndHashMatch(const QByteArray& packet) {
|
||||||
_domainInfo.setUUID(uuidFromPacketHeader(packet));
|
_domainInfo.setUUID(uuidFromPacketHeader(packet));
|
||||||
|
|
||||||
// we also know this domain-server requires no authentication
|
// we also know this domain-server requires no authentication
|
||||||
// so set the account manager root URL empty
|
// so set the account manager root URL to the default one
|
||||||
AccountManager::getInstance().setAuthURL(QUrl());
|
AccountManager::getInstance().setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_domainInfo.getUUID() == uuidFromPacketHeader(packet)) {
|
if (_domainInfo.getUUID() == uuidFromPacketHeader(packet)) {
|
||||||
|
|
Loading…
Reference in a new issue