@adminforth/two-factors-auth 1.8.9 → 1.9.0
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/TwoFAModal.vue +4 -1
- package/custom/TwoFactorsConfirmation.vue +12 -9
- package/custom/TwoFactorsSetup.vue +5 -2
- package/dist/custom/TwoFAModal.vue +4 -1
- package/dist/custom/TwoFactorsConfirmation.vue +12 -9
- package/dist/custom/TwoFactorsSetup.vue +5 -2
- package/package.json +1 -1
package/build.log
CHANGED
|
@@ -11,5 +11,5 @@ custom/package-lock.json
|
|
|
11
11
|
custom/package.json
|
|
12
12
|
custom/tsconfig.json
|
|
13
13
|
|
|
14
|
-
sent 31,
|
|
15
|
-
total size is 31,
|
|
14
|
+
sent 31,846 bytes received 134 bytes 63,960.00 bytes/sec
|
|
15
|
+
total size is 31,348 speedup is 0.98
|
package/custom/TwoFAModal.vue
CHANGED
|
@@ -80,13 +80,16 @@
|
|
|
80
80
|
function tagOtpInputs() {
|
|
81
81
|
const root = otpRoot.value;
|
|
82
82
|
if (!root) return;
|
|
83
|
-
root.querySelectorAll('input.otp-input')
|
|
83
|
+
const inputs = root.querySelectorAll('input.otp-input');
|
|
84
|
+
inputs.forEach((el, idx) => {
|
|
84
85
|
el.setAttribute('name', 'mfaCode');
|
|
85
86
|
el.setAttribute('id', `mfaCode-${idx + 1}`);
|
|
86
87
|
el.setAttribute('autocomplete', 'one-time-code');
|
|
87
88
|
el.setAttribute('inputmode', 'numeric');
|
|
88
89
|
el.setAttribute('aria-labelledby', 'mfaCode-label');
|
|
89
90
|
});
|
|
91
|
+
(inputs[0] as HTMLInputElement)?.focus();
|
|
92
|
+
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
function handlePaste(event: ClipboardEvent) {
|
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
@on-complete="handleOnComplete"
|
|
29
29
|
/>
|
|
30
30
|
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
31
|
+
<ErrorMessage :error="codeError" />
|
|
32
|
+
<div class="mt-6 flex justify-center">
|
|
33
|
+
<LinkButton
|
|
34
|
+
to="/login"
|
|
35
|
+
class="w-full"
|
|
36
|
+
>
|
|
37
|
+
{{$t('Back to login')}}
|
|
38
|
+
</LinkButton>
|
|
39
|
+
</div>
|
|
39
40
|
</div>
|
|
40
41
|
</div>
|
|
41
42
|
</div>
|
|
@@ -57,11 +58,13 @@
|
|
|
57
58
|
import { LinkButton } from '@/afcl';
|
|
58
59
|
import VOtpInput from "vue3-otp-input";
|
|
59
60
|
import { useI18n } from 'vue-i18n';
|
|
61
|
+
import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
60
62
|
|
|
61
63
|
const { t } = useI18n();
|
|
62
64
|
const code = ref(null);
|
|
63
65
|
const otpRoot = ref(null);
|
|
64
66
|
const bindValue = ref('');
|
|
67
|
+
const codeError = ref(null);
|
|
65
68
|
|
|
66
69
|
const handleOnComplete = (value) => {
|
|
67
70
|
sendCode(value);
|
|
@@ -108,7 +111,7 @@
|
|
|
108
111
|
if (resp.allowedLogin){
|
|
109
112
|
await user.finishLogin();
|
|
110
113
|
} else {
|
|
111
|
-
|
|
114
|
+
codeError.value = 'Invalid code';
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
@on-complete="handleOnComplete"
|
|
46
46
|
/>
|
|
47
47
|
</div>
|
|
48
|
+
<ErrorMessage :error="codeError" />
|
|
48
49
|
<!-- <Vue2FACodeInput v-model="code" autofocus /> -->
|
|
49
50
|
<div class="flex flex-row gap-2.5 h-12">
|
|
50
51
|
<LinkButton to="/login" class="w-full">
|
|
@@ -78,10 +79,12 @@ import Vue2FACodeInput from '@loltech/vue3-2fa-code-input';
|
|
|
78
79
|
import VOtpInput from "vue3-otp-input";
|
|
79
80
|
import adminforth from '@/adminforth';
|
|
80
81
|
import { useI18n } from 'vue-i18n';
|
|
82
|
+
import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
81
83
|
|
|
82
84
|
const { t } = useI18n();
|
|
83
85
|
|
|
84
86
|
const code = ref(null);
|
|
87
|
+
const codeError = ref(null);
|
|
85
88
|
const handleOnComplete = (value) => {
|
|
86
89
|
sendCode(value);
|
|
87
90
|
};
|
|
@@ -187,7 +190,7 @@ async function sendCode (value) {
|
|
|
187
190
|
if (resp.allowedLogin){
|
|
188
191
|
await user.finishLogin()
|
|
189
192
|
} else {
|
|
190
|
-
|
|
193
|
+
codeError.value = 'Invalid code';
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
196
|
|
|
@@ -214,7 +217,7 @@ const handleSkip = async () => {
|
|
|
214
217
|
if (resp.allowedLogin){
|
|
215
218
|
await user.finishLogin()
|
|
216
219
|
} else {
|
|
217
|
-
|
|
220
|
+
codeError.value = 'Something went wrong';
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
</script>
|
|
@@ -80,13 +80,16 @@
|
|
|
80
80
|
function tagOtpInputs() {
|
|
81
81
|
const root = otpRoot.value;
|
|
82
82
|
if (!root) return;
|
|
83
|
-
root.querySelectorAll('input.otp-input')
|
|
83
|
+
const inputs = root.querySelectorAll('input.otp-input');
|
|
84
|
+
inputs.forEach((el, idx) => {
|
|
84
85
|
el.setAttribute('name', 'mfaCode');
|
|
85
86
|
el.setAttribute('id', `mfaCode-${idx + 1}`);
|
|
86
87
|
el.setAttribute('autocomplete', 'one-time-code');
|
|
87
88
|
el.setAttribute('inputmode', 'numeric');
|
|
88
89
|
el.setAttribute('aria-labelledby', 'mfaCode-label');
|
|
89
90
|
});
|
|
91
|
+
(inputs[0] as HTMLInputElement)?.focus();
|
|
92
|
+
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
function handlePaste(event: ClipboardEvent) {
|
|
@@ -28,14 +28,15 @@
|
|
|
28
28
|
@on-complete="handleOnComplete"
|
|
29
29
|
/>
|
|
30
30
|
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
31
|
+
<ErrorMessage :error="codeError" />
|
|
32
|
+
<div class="mt-6 flex justify-center">
|
|
33
|
+
<LinkButton
|
|
34
|
+
to="/login"
|
|
35
|
+
class="w-full"
|
|
36
|
+
>
|
|
37
|
+
{{$t('Back to login')}}
|
|
38
|
+
</LinkButton>
|
|
39
|
+
</div>
|
|
39
40
|
</div>
|
|
40
41
|
</div>
|
|
41
42
|
</div>
|
|
@@ -57,11 +58,13 @@
|
|
|
57
58
|
import { LinkButton } from '@/afcl';
|
|
58
59
|
import VOtpInput from "vue3-otp-input";
|
|
59
60
|
import { useI18n } from 'vue-i18n';
|
|
61
|
+
import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
60
62
|
|
|
61
63
|
const { t } = useI18n();
|
|
62
64
|
const code = ref(null);
|
|
63
65
|
const otpRoot = ref(null);
|
|
64
66
|
const bindValue = ref('');
|
|
67
|
+
const codeError = ref(null);
|
|
65
68
|
|
|
66
69
|
const handleOnComplete = (value) => {
|
|
67
70
|
sendCode(value);
|
|
@@ -108,7 +111,7 @@
|
|
|
108
111
|
if (resp.allowedLogin){
|
|
109
112
|
await user.finishLogin();
|
|
110
113
|
} else {
|
|
111
|
-
|
|
114
|
+
codeError.value = 'Invalid code';
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
@on-complete="handleOnComplete"
|
|
46
46
|
/>
|
|
47
47
|
</div>
|
|
48
|
+
<ErrorMessage :error="codeError" />
|
|
48
49
|
<!-- <Vue2FACodeInput v-model="code" autofocus /> -->
|
|
49
50
|
<div class="flex flex-row gap-2.5 h-12">
|
|
50
51
|
<LinkButton to="/login" class="w-full">
|
|
@@ -78,10 +79,12 @@ import Vue2FACodeInput from '@loltech/vue3-2fa-code-input';
|
|
|
78
79
|
import VOtpInput from "vue3-otp-input";
|
|
79
80
|
import adminforth from '@/adminforth';
|
|
80
81
|
import { useI18n } from 'vue-i18n';
|
|
82
|
+
import ErrorMessage from '@/components/ErrorMessage.vue';
|
|
81
83
|
|
|
82
84
|
const { t } = useI18n();
|
|
83
85
|
|
|
84
86
|
const code = ref(null);
|
|
87
|
+
const codeError = ref(null);
|
|
85
88
|
const handleOnComplete = (value) => {
|
|
86
89
|
sendCode(value);
|
|
87
90
|
};
|
|
@@ -187,7 +190,7 @@ async function sendCode (value) {
|
|
|
187
190
|
if (resp.allowedLogin){
|
|
188
191
|
await user.finishLogin()
|
|
189
192
|
} else {
|
|
190
|
-
|
|
193
|
+
codeError.value = 'Invalid code';
|
|
191
194
|
}
|
|
192
195
|
}
|
|
193
196
|
|
|
@@ -214,7 +217,7 @@ const handleSkip = async () => {
|
|
|
214
217
|
if (resp.allowedLogin){
|
|
215
218
|
await user.finishLogin()
|
|
216
219
|
} else {
|
|
217
|
-
|
|
220
|
+
codeError.value = 'Something went wrong';
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
</script>
|