feat(login): Autofocus 2fa (#6128)

Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Cyril59310
2025-09-21 18:56:09 +02:00
committed by GitHub
parent aed7b63fc4
commit 34e6292397

View File

@@ -16,7 +16,7 @@
<div v-if="tokenRequired">
<div class="form-floating mt-3">
<input id="otp" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
<input id="otp" ref="otpInput" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
<label for="otp">{{ $t("Token") }}</label>
</div>
</div>
@@ -55,6 +55,16 @@ export default {
};
},
watch: {
tokenRequired(newVal) {
if (newVal) {
this.$nextTick(() => {
this.$refs.otpInput?.focus();
});
}
}
},
mounted() {
document.title += " - Login";
},