瀏覽代碼

AccountRemovalWork: remove cached owncloudClient after removing account

Otherwise, the account (which is identified by account name only) will reuse old token, if login is done right after account removal.

Three hours of debugging for one line of code

Signed-off-by: Álvaro Brey Vilas <alvaro.brey@nextcloud.com>
Álvaro Brey Vilas 3 年之前
父節點
當前提交
95046c4b5d
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/com/nextcloud/client/jobs/AccountRemovalWork.kt

+ 3 - 1
app/src/main/java/com/nextcloud/client/jobs/AccountRemovalWork.kt

@@ -58,7 +58,6 @@ import com.owncloud.android.utils.FileStorageUtils
 import com.owncloud.android.utils.PushUtils
 import org.greenrobot.eventbus.EventBus
 import java.io.File
-import java.util.ArrayList
 
 /**
  * Removes account and all local files
@@ -150,6 +149,9 @@ class AccountRemovalWork(
             deleteAppPasswordRemoteOperation.execute(optionNextcloudClient.get())
         }
 
+        // delete cached OwncloudClient
+        OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(user.toOwnCloudAccount())
+
         if (userRemoved) {
             eventBus.post(AccountRemovedEvent())
         }