@adminforth/two-factors-auth 4.1.4 → 4.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.log +1 -1
- package/dist/index.js +4 -1
- package/index.ts +4 -1
- package/package.json +1 -1
package/build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -44,7 +44,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
|
|
|
44
44
|
//check if user has 2FA set up
|
|
45
45
|
const users2FASecret = this.userRepository.getSecret(userRecord);
|
|
46
46
|
//check if user has any passkeys registered
|
|
47
|
-
|
|
47
|
+
let userHasPasskeys = false;
|
|
48
|
+
if (this.options.passkeys) {
|
|
49
|
+
userHasPasskeys = yield this.passkeyService.hasPasskeysForUser(adminUser.dbUser[userPkFieldName]);
|
|
50
|
+
}
|
|
48
51
|
// If user has either 2FA secret or any passkeys, they cannot skip
|
|
49
52
|
if (users2FASecret || userHasPasskeys) {
|
|
50
53
|
return { skipAllowed: false };
|
package/index.ts
CHANGED
|
@@ -53,7 +53,10 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
|
|
|
53
53
|
//check if user has 2FA set up
|
|
54
54
|
const users2FASecret = this.userRepository.getSecret(userRecord);
|
|
55
55
|
//check if user has any passkeys registered
|
|
56
|
-
|
|
56
|
+
let userHasPasskeys = false;
|
|
57
|
+
if(this.options.passkeys) {
|
|
58
|
+
userHasPasskeys = await this.passkeyService.hasPasskeysForUser(adminUser.dbUser[userPkFieldName]);
|
|
59
|
+
}
|
|
57
60
|
|
|
58
61
|
// If user has either 2FA secret or any passkeys, they cannot skip
|
|
59
62
|
if (users2FASecret || userHasPasskeys) {
|