Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4 from Wesseldr/authenticatorSelection-bugfix-wes…
Browse files Browse the repository at this point in the history
…seldr

Authenticator selection bugfix wesseldr
  • Loading branch information
JamesCullum authored Apr 14, 2020
2 parents fc49348 + 614e9b6 commit 26d87f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ class Fido2Lib {
if (this.config.authenticatorAttachment !== undefined ||
this.config.authenticatorRequireResidentKey !== undefined ||
this.config.authenticatorUserVerification !== undefined) {
options.authenticatorSelectionCriteria = {};
setOpt(options.authenticatorSelectionCriteria, "attachment", this.config.authenticatorAttachment);
setOpt(options.authenticatorSelectionCriteria, "requireResidentKey", this.config.authenticatorRequireResidentKey);
setOpt(options.authenticatorSelectionCriteria, "userVerification", this.config.authenticatorUserVerification);
options.authenticatorSelection = {};
setOpt(options.authenticatorSelection, "authenticatorAttachment", this.config.authenticatorAttachment);
setOpt(options.authenticatorSelection, "requireResidentKey", this.config.authenticatorRequireResidentKey);
setOpt(options.authenticatorSelection, "userVerification", this.config.authenticatorUserVerification);
}
setOpt(options, "rawChallenge", rawChallenge);

Expand Down
14 changes: 7 additions & 7 deletions test/mainTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,13 @@ describe("Fido2Lib", function() {
]);
assert.isNumber(opts.timeout);
assert.strictEqual(opts.timeout, 42);
assert.isObject(opts.authenticatorSelectionCriteria);
assert.isString(opts.authenticatorSelectionCriteria.attachment);
assert.strictEqual(opts.authenticatorSelectionCriteria.attachment, "platform");
assert.isBoolean(opts.authenticatorSelectionCriteria.requireResidentKey);
assert.strictEqual(opts.authenticatorSelectionCriteria.requireResidentKey, false);
assert.isString(opts.authenticatorSelectionCriteria.userVerification);
assert.strictEqual(opts.authenticatorSelectionCriteria.userVerification, "required");
assert.isObject(opts.authenticatorSelection);
assert.isString(opts.authenticatorSelection.authenticatorAttachment);
assert.strictEqual(opts.authenticatorSelection.authenticatorAttachment, "platform");
assert.isBoolean(opts.authenticatorSelection.requireResidentKey);
assert.strictEqual(opts.authenticatorSelection.requireResidentKey, false);
assert.isString(opts.authenticatorSelection.userVerification);
assert.strictEqual(opts.authenticatorSelection.userVerification, "required");
assert.isString(opts.attestation);
assert.strictEqual(opts.attestation, "none");
});
Expand Down

0 comments on commit 26d87f2

Please sign in to comment.