HttpCreds: Delete password from old location. #2186
authorChristian Kamm <kamm@incasoftware.de>
Thu, 26 Mar 2015 10:15:24 +0000 (11:15 +0100)
committerChristian Kamm <kamm@incasoftware.de>
Fri, 27 Mar 2015 09:40:19 +0000 (10:40 +0100)
src/libsync/creds/httpcredentials.cpp

index 2d5569d7d17e9136adbe0419cf85b15024bba046..0dd0e745c792df6b7b1f04762a9d4c32bece7587 100644 (file)
@@ -336,6 +336,14 @@ void HttpCredentials::invalidateToken()
     job->setKey(kck);
     job->start();
 
+    // Also ensure the password is deleted from the deprecated place
+    // otherwise we'd possibly read and use it again and again.
+    DeletePasswordJob *job2 = new DeletePasswordJob(Theme::instance()->appName());
+    // no job2->setSettings() call here, to make it use the deprecated location.
+    job2->setInsecureFallback(true);
+    job2->setKey(kck);
+    job2->start();
+
     _account->clearCookieJar();
 }