mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
generate a new keypair on every interface launch
This commit is contained in:
parent
7cb8cbfdd4
commit
5ecdb58e20
3 changed files with 4 additions and 9 deletions
|
@ -278,6 +278,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
|
|
||||||
connect(&accountManager, &AccountManager::authRequired, Menu::getInstance(), &Menu::loginForCurrentDomain);
|
connect(&accountManager, &AccountManager::authRequired, Menu::getInstance(), &Menu::loginForCurrentDomain);
|
||||||
connect(&accountManager, &AccountManager::usernameChanged, this, &Application::updateWindowTitle);
|
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
|
// 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);
|
accountManager.setAuthURL(DEFAULT_NODE_AUTH_URL);
|
||||||
|
|
|
@ -146,12 +146,6 @@ void AccountManager::setAuthURL(const QUrl& authURL) {
|
||||||
} else {
|
} else {
|
||||||
requestProfile();
|
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();
|
persistAccountToSettings();
|
||||||
|
|
||||||
requestProfile();
|
requestProfile();
|
||||||
generateNewKeypair();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: error handling
|
// TODO: error handling
|
||||||
|
|
|
@ -80,6 +80,7 @@ public slots:
|
||||||
void logout();
|
void logout();
|
||||||
void updateBalance();
|
void updateBalance();
|
||||||
void accountInfoBalanceChanged(qint64 newBalance);
|
void accountInfoBalanceChanged(qint64 newBalance);
|
||||||
|
void generateNewKeypair();
|
||||||
signals:
|
signals:
|
||||||
void authRequired();
|
void authRequired();
|
||||||
void authEndpointChanged();
|
void authEndpointChanged();
|
||||||
|
@ -102,8 +103,6 @@ private:
|
||||||
|
|
||||||
void passSuccessToCallback(QNetworkReply* reply);
|
void passSuccessToCallback(QNetworkReply* reply);
|
||||||
void passErrorToCallback(QNetworkReply* reply);
|
void passErrorToCallback(QNetworkReply* reply);
|
||||||
|
|
||||||
void generateNewKeypair();
|
|
||||||
|
|
||||||
Q_INVOKABLE void invokedRequest(const QString& path,
|
Q_INVOKABLE void invokedRequest(const QString& path,
|
||||||
bool requiresAuthentication,
|
bool requiresAuthentication,
|
||||||
|
|
Loading…
Reference in a new issue