1
0
Fork 1
mirror of https://example.com synced 2024-11-22 10:36:38 +09:00

fix(frontend): show 2fa code field in login only if 2fa is enabled

This commit is contained in:
TrojanerHD 2024-02-24 02:22:47 +01:00 committed by naskya
parent 437d02ef5d
commit 0a270ca31a
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -79,10 +79,10 @@
{{ i18n.ts.retry }}
</MkButton>
</div>
<div v-if="user && user.securityKeys" class="or-hr">
<div v-if="user && user.securityKeys && user.twoFactorEnabled" class="or-hr">
<p class="or-msg">{{ i18n.ts.or }}</p>
</div>
<div class="twofa-group totp-group">
<div v-if="user.twoFactorEnabled" class="twofa-group totp-group">
<p style="margin-bottom: 0">
{{ i18n.ts.twoStepAuthentication }}
</p>
@ -247,7 +247,6 @@ function queryKey() {
function onSubmit() {
signing.value = true;
console.log("submit");
if (!totpLogin.value && user.value && user.value.twoFactorEnabled) {
if (window.PublicKeyCredential && user.value.securityKeys) {
os.api("signin", {
username: username.value,
@ -262,10 +261,9 @@ function onSubmit() {
return queryKey();
})
.catch(loginFailed);
} else {
} else if (!totpLogin.value && user.value && user.value.twoFactorEnabled) {
totpLogin.value = true;
signing.value = false;
}
} else {
os.api("signin", {
username: username.value,