martinkasa / capacitor-secure-storage-plugin

Capacitor plugin for storing string values securly on iOS and Android.
MIT License
152 stars 53 forks source link

`clear()` throws error on iOS if secure storage is empty #63

Closed dennisameling closed 1 year ago

dennisameling commented 1 year ago

When the Keychain is already empty and then calling SecureStoragePlugin.clear() on iOS, it throws an error:

⚡️  To Native ->  SecureStoragePlugin clear 101871643
⚡️  [error] - {"message":"error","errorMessage":"error"}

This is inconsistent with Android, which simply returns true if the Secure Storage was already empty.

I'd expect this method to simply return true if the Keychain was already empty. Throwing an error suggests that something went wrong in the removal process, which is not the case.

Would it be possible to either:

Thanks in advance!

martinkasa commented 1 year ago

Thanks for reporting the issue. It is fixed in v0.8.1 by #69

dennisameling commented 1 year ago

Thank you! Appreciate it 🎉