Skip to content

Password field #45

Description

@mmajcica

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions