Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password field #45

Open
mmajcica opened this issue Jul 4, 2022 · 0 comments
Open

Password field #45

mmajcica opened this issue Jul 4, 2022 · 0 comments

Comments

@mmajcica
Copy link

mmajcica commented Jul 4, 2022

We are experiencing some inconsistent behavior with the Password field. Following code:

const entry = db.getDefaultGroup().entries.find((e) => e.fields.get('UserName') === entryName);
const passwordField = entry.fields.get('Password');

Sometimes returns an object of type ProtectedValue, sometime is a string. This is pushing us to implement the readout of that field in the following way:

const passwordField = entry.fields.get('Password');
let password = '';

if (passwordField instanceof kdbxweb.ProtectedValue) {
    password = (passwordField as kdbxweb.ProtectedValue).getText();
} else {
    password = passwordField;
}

Is there a reason for this behavior or is there a better way to prevent/fetch this?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant