@adminforth/two-factors-auth 1.8.8 → 1.8.10

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 CHANGED
@@ -11,5 +11,5 @@ custom/package-lock.json
11
11
  custom/package.json
12
12
  custom/tsconfig.json
13
13
 
14
- sent 31,440 bytes received 134 bytes 63,148.00 bytes/sec
15
- total size is 30,942 speedup is 0.98
14
+ sent 31,567 bytes received 134 bytes 63,402.00 bytes/sec
15
+ total size is 31,076 speedup is 0.98
@@ -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').forEach((el, idx) => {
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) {
@@ -124,6 +127,7 @@
124
127
  function onCancel() {
125
128
  modelShow.value = false;
126
129
  bindValue.value = '';
130
+ code.value?.clearInput();
127
131
  emit('rejected', new Error('cancelled'));
128
132
  emit('closed');
129
133
  }
@@ -144,6 +148,7 @@
144
148
  htmlRef.style.overflow = '';
145
149
  }
146
150
  bindValue.value = '';
151
+ code.value?.clearInput();
147
152
  }
148
153
  });
149
154
 
@@ -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').forEach((el, idx) => {
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) {
@@ -124,6 +127,7 @@
124
127
  function onCancel() {
125
128
  modelShow.value = false;
126
129
  bindValue.value = '';
130
+ code.value?.clearInput();
127
131
  emit('rejected', new Error('cancelled'));
128
132
  emit('closed');
129
133
  }
@@ -144,6 +148,7 @@
144
148
  htmlRef.style.overflow = '';
145
149
  }
146
150
  bindValue.value = '';
151
+ code.value?.clearInput();
147
152
  }
148
153
  });
149
154
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/two-factors-auth",
3
- "version": "1.8.8",
3
+ "version": "1.8.10",
4
4
  "description": "AdminForth plugin for two factors authentication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",