diff --git a/core/core-frontend/src/views/mobile/login/index.vue b/core/core-frontend/src/views/mobile/login/index.vue index f1683a0b42..0e7be4e9bd 100644 --- a/core/core-frontend/src/views/mobile/login/index.vue +++ b/core/core-frontend/src/views/mobile/login/index.vue @@ -143,12 +143,7 @@ const onSubmit = async () => { return } showMfa.value = false - if (!isLdap && mfa?.enabled) { - for (const key in mfa) { - mfaData.value[key] = mfa[key] - } - showMfa.value = true - duringLogin.value = false + if (toMfa(mfa)) { return } userStore.setToken(token) @@ -177,6 +172,19 @@ const switchType = type => { const toMain = () => { router.push({ path: '/index' }) } +const toMfa = (mfa: any) => { + const isLdap = loginType.value === 'ldap' + if (!isLdap && mfa?.enabled) { + for (const key in mfa) { + mfaData.value[key] = mfa[key] + } + showMfa.value = true + duringLogin.value = false + showPlatLoginMask.value = false + return true + } + return false +} const loadFail = () => { xpackLoadFail.value = true showPlatLoginMask.value = false @@ -248,6 +256,7 @@ const loadFail = () => {