Only submit 2FA automatically once

This commit is contained in:
Matej Bačo authored and Torsten Dittmann committed 2024-02-27 20:08:51 +01:00
1 parent fa1050d02d
commit 38e82bd8e3
1 file changed
+4 -1
+4 -1
View File
@@ -13,6 +13,8 @@
let element: HTMLOListElement;
let autoSubmitted = false;
const {
elements: { root, input }
} = createPinInput({
@@ -21,7 +23,8 @@
onValueChange: ({ next }) => {
value = next.join('');
if (value.length === 6) {
if (value.length === 6 && !autoSubmitted) {
autoSubmitted = true;
const firstInputElement = element.querySelector('input');
firstInputElement?.form.requestSubmit();
}