forked from naskya/firefish
fix(frontend): show 2fa code field in login only if 2fa is enabled
This commit is contained in:
parent
437d02ef5d
commit
0a270ca31a
1 changed files with 18 additions and 20 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue