From 1163cfd07e3f7312920e33c56f0e3e40ece2af83 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 25 Feb 2014 10:58:32 -0800 Subject: [PATCH] if the domain-server provides no auth, assume default --- interface/src/Menu.cpp | 12 +----------- libraries/shared/src/NodeList.cpp | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index dc8116c09f..a0710cf463 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -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); } } diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 36e22e2a77..98387ce420 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -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)) {