Skip to content

Commit

Permalink
Merge #827(tobias): Fix saving access token to keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal authored Nov 10, 2024
2 parents 294d8a5 + 362a9ad commit 8f5b4ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Quotient/connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ void Connection::Private::loginToServer(LoginArgTs&&... loginArgs)
q->callApi<LoginJob>(std::forward<LoginArgTs>(loginArgs)...)
.onResult([this](const LoginJob* loginJob) {
if (loginJob->status().good()) {
saveAccessTokenToKeychain();
completeSetup(loginJob->userId(), true, loginJob->deviceId(),
loginJob->accessToken());
} else
Expand All @@ -315,6 +314,10 @@ void Connection::Private::completeSetup(const QString& mxId, bool newLogin,
<< "from device" << data->deviceId();
connect(qApp, &QCoreApplication::aboutToQuit, q, &Connection::saveState);

if (newLogin) {
saveAccessTokenToKeychain();
}

if (accessToken.has_value()) {
q->loadVersions();
q->loadCapabilities();
Expand Down

0 comments on commit 8f5b4ea

Please sign in to comment.