node-keytar
node-keytar copied to clipboard
Is it not possible to store an empty password?
When trying to store an empty password ("") the following error is returned:
Error: Password is required
This feels weird to me, since an empty password is in many cases a "valid password". So it would be nice to be able to store an empty password so that I know if I've asked the user for a password or not.
I.e. the return value is null if a password hasn't been stored. And the return value is "" if an empty password has been stored.
Why is this not supported? Technical limitation?
I believe that this behaviour is related to this line inside setPassword:
https://github.com/atom/node-keytar/blob/fd66226fb556a3333c9474b5e56e208724dd6dc7/lib/keytar.js#L36
I'm fine with it checking to avoid sending null or undefined through to the native APIs, but maybe an empty string is fine?
I don't have any strong opinions on this, but feel free to open a PR and we can talk about this further if this is something you still care about.