mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
handle login failure, have AccountManager generate keypair
This commit is contained in:
parent
64fda3253e
commit
dc84c336ea
4 changed files with 12 additions and 3 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QMessageBox>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
|
||||
#ifndef ANDROID
|
||||
|
@ -142,6 +143,12 @@ void GVRMainWindow::showLoginDialog() {
|
|||
// have the acccount manager handle credentials from LoginDialog
|
||||
AccountManager& accountManager = AccountManager::getInstance();
|
||||
connect(loginDialog, &LoginDialog::credentialsEntered, &accountManager, &AccountManager::requestAccessToken);
|
||||
connect(&accountManager, &AccountManager::loginFailed, this, &GVRMainWindow::showLoginFailure);
|
||||
|
||||
_mainLayout->addWidget(loginDialog);
|
||||
}
|
||||
|
||||
void GVRMainWindow::showLoginFailure() {
|
||||
QMessageBox::warning(this, "Login Failed",
|
||||
"Could not log in with that username and password. Please try again!");
|
||||
}
|
||||
|
|
|
@ -31,6 +31,8 @@ public slots:
|
|||
void showAddressBar();
|
||||
void showLoginDialog();
|
||||
|
||||
void showLoginFailure();
|
||||
|
||||
#if defined(ANDROID) && defined(HAVE_LIBOVR)
|
||||
OVR::KeyState& getBackKeyState() { return _backKeyState; }
|
||||
#endif
|
||||
|
|
|
@ -341,9 +341,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||
connect(&accountManager, &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
|
||||
connect(&accountManager, &AccountManager::usernameChanged, this, &Application::updateWindowTitle);
|
||||
|
||||
// once we have a profile in account manager make sure we generate a new keypair
|
||||
connect(&accountManager, &AccountManager::profileChanged, &accountManager, &AccountManager::generateNewKeypair);
|
||||
|
||||
// set the account manager's root URL and trigger a login request if we don't have the access token
|
||||
accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||
|
|
|
@ -79,6 +79,9 @@ AccountManager::AccountManager() :
|
|||
qRegisterMetaType<QHttpMultiPart*>("QHttpMultiPart*");
|
||||
|
||||
connect(&_accountInfo, &DataServerAccountInfo::balanceChanged, this, &AccountManager::accountInfoBalanceChanged);
|
||||
|
||||
// once we have a profile in account manager make sure we generate a new keypair
|
||||
connect(this, &AccountManager::profileChanged, this, &AccountManager::generateNewKeypair);
|
||||
}
|
||||
|
||||
const QString DOUBLE_SLASH_SUBSTITUTE = "slashslash";
|
||||
|
|
Loading…
Reference in a new issue