logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

auth_form.js (698B)


  1. import { h, resolveComponent } from 'vue'
  2. import LoginForm from '../login_form/login_form.vue'
  3. import MFARecoveryForm from '../mfa_form/recovery_form.vue'
  4. import MFATOTPForm from '../mfa_form/totp_form.vue'
  5. import { mapGetters } from 'vuex'
  6. const AuthForm = {
  7. name: 'AuthForm',
  8. render () {
  9. return h(resolveComponent(this.authForm))
  10. },
  11. computed: {
  12. authForm () {
  13. if (this.requiredTOTP) { return 'MFATOTPForm' }
  14. if (this.requiredRecovery) { return 'MFARecoveryForm' }
  15. return 'LoginForm'
  16. },
  17. ...mapGetters('authFlow', ['requiredTOTP', 'requiredRecovery'])
  18. },
  19. components: {
  20. MFARecoveryForm,
  21. MFATOTPForm,
  22. LoginForm
  23. }
  24. }
  25. export default AuthForm