2021-04-25 11:44:07 +00:00
|
|
|
import { h, resolveComponent } from 'vue'
|
2019-06-12 20:16:55 +00:00
|
|
|
import LoginForm from '../login_form/login_form.vue'
|
|
|
|
import MFARecoveryForm from '../mfa_form/recovery_form.vue'
|
|
|
|
import MFATOTPForm from '../mfa_form/totp_form.vue'
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
|
|
|
const AuthForm = {
|
|
|
|
name: 'AuthForm',
|
2021-04-25 11:44:07 +00:00
|
|
|
render () {
|
|
|
|
return h(resolveComponent(this.authForm))
|
2019-06-12 20:16:55 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
authForm () {
|
|
|
|
if (this.requiredTOTP) { return 'MFATOTPForm' }
|
|
|
|
if (this.requiredRecovery) { return 'MFARecoveryForm' }
|
|
|
|
return 'LoginForm'
|
|
|
|
},
|
|
|
|
...mapGetters('authFlow', ['requiredTOTP', 'requiredRecovery'])
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
MFARecoveryForm,
|
|
|
|
MFATOTPForm,
|
|
|
|
LoginForm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AuthForm
|