mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-16 14:10:43 +02:00
fix login/logout flow when jumping domains
This commit is contained in:
parent
6d847f29fb
commit
2496c6252f
3 changed files with 7 additions and 1 deletions
|
@ -94,7 +94,7 @@ Menu::Menu() :
|
|||
toggleLoginMenuItem();
|
||||
|
||||
// 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::foundOrRequestedAccessToken, this, &Menu::toggleLoginMenuItem);
|
||||
connect(&accountManager, &AccountManager::logoutComplete, this, &Menu::toggleLoginMenuItem);
|
||||
|
||||
addDisabledActionAndSeparator(fileMenu, "Scripts");
|
||||
|
|
|
@ -88,6 +88,8 @@ void AccountManager::setAuthURL(const QUrl& authURL) {
|
|||
// pull out the stored access token and store it in memory
|
||||
_accountInfo = settings.value(key).value<DataServerAccountInfo>();
|
||||
qDebug() << "Found a data-server access token for" << qPrintable(keyURL.toString());
|
||||
|
||||
emit foundOrRequestedAccessToken();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,6 +274,9 @@ void AccountManager::requestFinished() {
|
|||
// the username has changed to whatever came back
|
||||
emit usernameChanged(_accountInfo.getUsername());
|
||||
|
||||
// we have found or requested an access token
|
||||
emit foundOrRequestedAccessToken();
|
||||
|
||||
// store this access token into the local settings
|
||||
QSettings localSettings;
|
||||
localSettings.beginGroup(ACCOUNTS_GROUP);
|
||||
|
|
|
@ -61,6 +61,7 @@ signals:
|
|||
void authRequired();
|
||||
void authEndpointChanged();
|
||||
void usernameChanged(const QString& username);
|
||||
void foundOrRequestedAccessToken();
|
||||
void loginComplete(const QUrl& authURL);
|
||||
void logoutComplete();
|
||||
private slots:
|
||||
|
|
Loading…
Reference in a new issue