Merge pull request #3622 from birarda/domain-tunnel

work around double login issue by generating keypair on each launch
This commit is contained in:
Andrzej Kapolka 2014-10-17 18:05:45 -07:00
commit e98b99fe84
3 changed files with 4 additions and 9 deletions

View file

@ -277,6 +277,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
connect(&accountManager, &AccountManager::authRequired, Menu::getInstance(), &Menu::loginForCurrentDomain);
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);

View file

@ -146,12 +146,6 @@ void AccountManager::setAuthURL(const QUrl& authURL) {
} else {
requestProfile();
}
// if we don't have a private key in settings we should generate a new keypair
if (!_accountInfo.hasPrivateKey()) {
qDebug() << "No private key present - generating a new key-pair.";
generateNewKeypair();
}
}
}
}
@ -427,7 +421,6 @@ void AccountManager::requestAccessTokenFinished() {
persistAccountToSettings();
requestProfile();
generateNewKeypair();
}
} else {
// TODO: error handling

View file

@ -80,6 +80,7 @@ public slots:
void logout();
void updateBalance();
void accountInfoBalanceChanged(qint64 newBalance);
void generateNewKeypair();
signals:
void authRequired();
void authEndpointChanged();
@ -102,8 +103,6 @@ private:
void passSuccessToCallback(QNetworkReply* reply);
void passErrorToCallback(QNetworkReply* reply);
void generateNewKeypair();
Q_INVOKABLE void invokedRequest(const QString& path,
bool requiresAuthentication,