Skip to content

Commit

Permalink
delete public key if storage of private key did not worked
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Feb 14, 2018
1 parent 6a35a44 commit 04de5ca
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import com.owncloud.android.lib.common.UserInfo;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.users.DeletePublicKeyOperation;
import com.owncloud.android.lib.resources.users.GetPrivateKeyOperation;
import com.owncloud.android.lib.resources.users.GetPublicKeyOperation;
import com.owncloud.android.lib.resources.users.GetRemoteUserInfoOperation;
Expand Down Expand Up @@ -346,8 +347,7 @@ protected String doInBackground(Void... voids) {

// get user id
String userID;
GetRemoteUserInfoOperation remoteUserNameOperation =
new GetRemoteUserInfoOperation();
GetRemoteUserInfoOperation remoteUserNameOperation = new GetRemoteUserInfoOperation();
RemoteOperationResult remoteUserNameOperationResult = remoteUserNameOperation
.execute(account, getContext(), true);

Expand Down Expand Up @@ -398,8 +398,10 @@ protected String doInBackground(Void... voids) {

keyResult = KEY_CREATED;
return (String) storePrivateKeyResult.getData().get(0);
} else {
DeletePublicKeyOperation deletePublicKeyOperation = new DeletePublicKeyOperation();
deletePublicKeyOperation.execute(account, getContext(), true);
}

} catch (Exception e) {
Log_OC.e(TAG, e.getMessage());
}
Expand Down

0 comments on commit 04de5ca

Please sign in to comment.