@adminforth/two-factors-auth 2.9.11 → 2.9.13
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 +2 -2
- package/custom/LoginWithPasskeyButton.vue +5 -3
- package/custom/TwoFactorsSetup.vue +2 -0
- package/custom/utils.js +2 -2
- package/dist/custom/LoginWithPasskeyButton.vue +5 -3
- package/dist/custom/TwoFactorsSetup.vue +2 -0
- package/dist/custom/utils.js +2 -2
- package/dist/index.js +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -15,5 +15,5 @@ custom/package.json
|
|
|
15
15
|
custom/tsconfig.json
|
|
16
16
|
custom/utils.js
|
|
17
17
|
|
|
18
|
-
sent 273,
|
|
19
|
-
total size is 272,
|
|
18
|
+
sent 273,800 bytes received 210 bytes 548,020.00 bytes/sec
|
|
19
|
+
total size is 272,973 speedup is 1.00
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<Button
|
|
4
|
-
class="w-full !py-
|
|
4
|
+
class="w-full !py-2"
|
|
5
5
|
@click="handleLoginWithPasskey"
|
|
6
6
|
>
|
|
7
|
-
|
|
8
|
-
<
|
|
7
|
+
<div class="flex items-center justify-center">
|
|
8
|
+
<IconShieldOutline class="w-6 h-6 mr-1" />
|
|
9
|
+
<span>{{ $t('Continue with Passkey') }}</span>
|
|
10
|
+
</div>
|
|
9
11
|
</Button>
|
|
10
12
|
|
|
11
13
|
</template>
|
|
@@ -254,6 +254,7 @@ async function sendCode (value) {
|
|
|
254
254
|
}
|
|
255
255
|
})
|
|
256
256
|
if (resp.allowedLogin) {
|
|
257
|
+
localStorage.setItem('twofa-skip-setup', 'false');
|
|
257
258
|
if ( route.meta.isPasskeysEnabled ) {
|
|
258
259
|
handlePasskeyAlert(route.meta.suggestionPeriod, router);
|
|
259
260
|
}
|
|
@@ -276,6 +277,7 @@ function handlePaste(event) {
|
|
|
276
277
|
}
|
|
277
278
|
|
|
278
279
|
const handleSkip = async () => {
|
|
280
|
+
localStorage.setItem('twofa-skip-setup', 'true');
|
|
279
281
|
const resp = await callAdminForthApi({
|
|
280
282
|
method: 'POST',
|
|
281
283
|
path: '/plugin/twofa/confirmLogin',
|
package/custom/utils.js
CHANGED
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
suggestPasskey = window.localStorage.getItem('suggestPasskey');
|
|
29
|
-
|
|
30
|
-
if ( suggestPasskey === 'true' ) {
|
|
29
|
+
let userSkippedSetup = window.localStorage.getItem('twofa-skip-setup');
|
|
30
|
+
if ( suggestPasskey === 'true' && userSkippedSetup !== 'true') {
|
|
31
31
|
adminforth.alert({
|
|
32
32
|
message: 'Do you want to add passkey?',
|
|
33
33
|
variant: 'info',
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
|
|
3
3
|
<Button
|
|
4
|
-
class="w-full !py-
|
|
4
|
+
class="w-full !py-2"
|
|
5
5
|
@click="handleLoginWithPasskey"
|
|
6
6
|
>
|
|
7
|
-
|
|
8
|
-
<
|
|
7
|
+
<div class="flex items-center justify-center">
|
|
8
|
+
<IconShieldOutline class="w-6 h-6 mr-1" />
|
|
9
|
+
<span>{{ $t('Continue with Passkey') }}</span>
|
|
10
|
+
</div>
|
|
9
11
|
</Button>
|
|
10
12
|
|
|
11
13
|
</template>
|
|
@@ -254,6 +254,7 @@ async function sendCode (value) {
|
|
|
254
254
|
}
|
|
255
255
|
})
|
|
256
256
|
if (resp.allowedLogin) {
|
|
257
|
+
localStorage.setItem('twofa-skip-setup', 'false');
|
|
257
258
|
if ( route.meta.isPasskeysEnabled ) {
|
|
258
259
|
handlePasskeyAlert(route.meta.suggestionPeriod, router);
|
|
259
260
|
}
|
|
@@ -276,6 +277,7 @@ function handlePaste(event) {
|
|
|
276
277
|
}
|
|
277
278
|
|
|
278
279
|
const handleSkip = async () => {
|
|
280
|
+
localStorage.setItem('twofa-skip-setup', 'true');
|
|
279
281
|
const resp = await callAdminForthApi({
|
|
280
282
|
method: 'POST',
|
|
281
283
|
path: '/plugin/twofa/confirmLogin',
|
package/dist/custom/utils.js
CHANGED
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
suggestPasskey = window.localStorage.getItem('suggestPasskey');
|
|
29
|
-
|
|
30
|
-
if ( suggestPasskey === 'true' ) {
|
|
29
|
+
let userSkippedSetup = window.localStorage.getItem('twofa-skip-setup');
|
|
30
|
+
if ( suggestPasskey === 'true' && userSkippedSetup !== 'true') {
|
|
31
31
|
adminforth.alert({
|
|
32
32
|
message: 'Do you want to add passkey?',
|
|
33
33
|
variant: 'info',
|
package/dist/index.js
CHANGED
|
@@ -463,7 +463,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
|
|
|
463
463
|
}
|
|
464
464
|
const passkeyRecord = yield this.adminforth.resource(this.options.passkeys.credentialResourceID).get([Filters.EQ(this.options.passkeys.credentialIdFieldName, credential_id)]);
|
|
465
465
|
if (!passkeyRecord) {
|
|
466
|
-
return { error: 'No
|
|
466
|
+
return { error: 'No such passkey found, most likeley it was removed on this website but you still have it on your device' };
|
|
467
467
|
}
|
|
468
468
|
const userPk = passkeyRecord[this.options.passkeys.credentialUserIdFieldName];
|
|
469
469
|
if (!userPk) {
|
package/index.ts
CHANGED
|
@@ -506,7 +506,7 @@ export default class TwoFactorsAuthPlugin extends AdminForthPlugin {
|
|
|
506
506
|
|
|
507
507
|
const passkeyRecord = await this.adminforth.resource(this.options.passkeys.credentialResourceID).get([Filters.EQ(this.options.passkeys.credentialIdFieldName, credential_id)]);
|
|
508
508
|
if (!passkeyRecord) {
|
|
509
|
-
return { error: 'No
|
|
509
|
+
return { error: 'No such passkey found, most likeley it was removed on this website but you still have it on your device' };
|
|
510
510
|
}
|
|
511
511
|
|
|
512
512
|
const userPk = passkeyRecord[this.options.passkeys.credentialUserIdFieldName];
|