mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
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>
This commit is contained in:
parent
23a72722d3
commit
95046c4b5d
1 changed files with 3 additions and 1 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue