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

Co-authored-by: Frank Elsinga <frank@elsinga.de>
pull/6098/head^2
Cyril59310 2025-09-21 18:56:09 +02:00 committed by GitHub
parent aed7b63fc4
commit 34e6292397
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 1 deletions

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";
},