mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:44:01 +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(&accountManager, &AccountManager::loginComplete, this, &Menu::toggleLoginMenuItem);
|
||||
connect(&accountManager, &AccountManager::logoutComplete, this, &Menu::toggleLoginMenuItem);
|
||||
connect(&accountManager, &AccountManager::authEndpointChanged, this, &Menu::toggleLoginMenuItem);
|
||||
|
||||
addDisabledActionAndSeparator(fileMenu, "Scripts");
|
||||
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
|
||||
_loginAction->setText("Logout " + accountManager.getUsername());
|
||||
connect(_loginAction, &QAction::triggered, &accountManager, &AccountManager::logout);
|
||||
|
||||
_loginAction->setEnabled(true);
|
||||
} else {
|
||||
// change the menu item to 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);
|
||||
_loginAction->setEnabled(true);
|
||||
} else {
|
||||
_loginAction->setEnabled(false);
|
||||
}
|
||||
connect(_loginAction, &QAction::triggered, this, &Menu::loginForCurrentDomain);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,8 +119,8 @@ bool NodeList::packetVersionAndHashMatch(const QByteArray& packet) {
|
|||
_domainInfo.setUUID(uuidFromPacketHeader(packet));
|
||||
|
||||
// we also know this domain-server requires no authentication
|
||||
// so set the account manager root URL empty
|
||||
AccountManager::getInstance().setAuthURL(QUrl());
|
||||
// so set the account manager root URL to the default one
|
||||
AccountManager::getInstance().setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||
}
|
||||
|
||||
if (_domainInfo.getUUID() == uuidFromPacketHeader(packet)) {
|
||||
|
|
Loading…
Reference in a new issue