Skip to content

Commit

Permalink
fix: broken checkPasswordQuality
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanWilbur committed Mar 13, 2024
1 parent d3a466c commit 9b5480f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions apps/meerkat/src/app/password/checkPasswordQuality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,21 @@ async function checkPasswordQuality (
return CHECK_PWD_QUALITY_LENGTH;
}

const alphabet: string[] = (await ctx.db.attributeValue.findFirst({
const alphabetResult = await ctx.db.attributeValue.findFirst({
where: {
entry_id: subentry.dse.id,
type_oid: pwdAlphabet["&id"].toBytes(),
},
select: {
jer: true,
tag_class: true,
tag_number: true,
constructed: true,
content_octets: true,
},
}))?.jer as string[] ?? [];
});
const alphabet = alphabetResult
? pwdAlphabet.decoderFor["&Type"]!(attributeValueFromDB(alphabetResult))
: [];

const passwordCharacters: Set<string> = new Set(Array.from(password));
// TODO: Unit testing to ensure the continue-to-label works as expected.
Expand Down

0 comments on commit 9b5480f

Please sign in to comment.