AccountManager: load the cookies
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 1 Mar 2019 07:46:33 +0000 (08:46 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:43 +0000 (10:58 +0100)
For issue #7054

src/gui/accountmanager.cpp

index 3c75f3d54d5671842bd48bc5cb5498b4bd93a114..577320447ec5743fad791de87714fbe68e6b737d 100644 (file)
@@ -16,6 +16,7 @@
 #include "configfile.h"
 #include "sslerrordialog.h"
 #include "proxyauthhandler.h"
+#include "common/asserts.h"
 #include <theme.h>
 #include <creds/credentialsfactory.h>
 #include <creds/abstractcredentials.h>
@@ -85,6 +86,10 @@ bool AccountManager::restore()
             if (auto acc = loadAccountHelper(*settings)) {
                 acc->_id = accountId;
                 if (auto accState = AccountState::loadFromSettings(acc, *settings)) {
+                    auto jar = qobject_cast<CookieJar*>(acc->_am->cookieJar());
+                    ASSERT(jar);
+                    if (jar)
+                        jar->restore(acc->cookieJarPath());
                     addAccountState(accState);
                 }
             }