if the domain-server provides no auth, assume default

This commit is contained in:
Stephen Birarda 2014-02-25 10:58:32 -08:00
parent b09ed1dff1
commit 1163cfd07e
2 changed files with 3 additions and 13 deletions

View file

@ -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);
}
}

View file

@ -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)) {