flutter_secure_storage
flutter_secure_storage copied to clipboard
macOS - containsKey is always returning true
No matter what key I'm passing for the containsKey
function, this always returns true the first time on a macOS build.
Is anyone else getting this issue? Let me know what other information you might need to help resolve.
I have the same issue on iOS Iphone 12 simulator -> containsKey returns true but read returns null, used to work on stable release. temporary bypass for me is a function to check contains by calling
await _secureStorage.containsKey(key: _tokenKey) && await _secureStorage.read(key: _tokenKey) != null;
@pikawika I'll try the workaround! Thank you!
Please try again using the latest v5.0.0. If issue still exists feel free to comment.
Problem still exists in package 5.0.2
+1
Pretty critical/hardcore bug when you use this function to check if a user is LoggedIn or not ...
Maybe this plugin is not so secure ^^
Pretty critical/hardcore bug when you use this function to check if a user is LoggedIn or not ...
You should not use this function to check if a user is logged in or not. You should read the actual data that it has and check if it is still valid or not expired like a token.
It's up to me and you don't know of any of the other technical details. If you think containsKey has no use, remove it from the lib
But yeah now that containsKey is totally broke, I don't really have a choice
It's up to me and you don't know of any of the other technical details. If you think containsKey has no use, remove it from the lib
It has a use, it should be used to check if a certain key is available as to not have null errors when trying to access that key. For as far as I know the check I provided will manually do null check and thus achieve the same result as this function, temporarily bypassing this bug. :)
It's up to me and you don't know of any of the other technical details.
Ofcourse it's up to you. I'm saying that this function is not designed for that purpose the way you described it in your first comment.
I am aware that there are some bugs in this lib, and i hope someone can help and fix some of those as i don't have all the time to fix those myself. I am always open for PR's
this issue still exist in v5.1.2