aboutsummaryrefslogtreecommitdiff
path: root/src/components/auth_form/auth_form.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-06-13 00:51:14 +0300
committerHenry Jameson <me@hjkos.com>2019-06-13 00:51:14 +0300
commitc8a57ad32e6d47a114e3d744b4b6a0666e9e01f7 (patch)
treede02290d6d97733c0ff7a041731b8c95e98b6c95 /src/components/auth_form/auth_form.js
parent1e94aecbc951c7508a0063de0c6cd90b40a040d8 (diff)
parente53f11c30fb2eedd0a437d3cfe9592c555de6a95 (diff)
Merge remote-tracking branch 'upstream/develop' into masto-register-app-secret
* upstream/develop: Revert "add TOTP/Recovery Form for mobile version"
Diffstat (limited to 'src/components/auth_form/auth_form.js')
-rw-r--r--src/components/auth_form/auth_form.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/components/auth_form/auth_form.js b/src/components/auth_form/auth_form.js
new file mode 100644
index 00000000..e9a6e2d5
--- /dev/null
+++ b/src/components/auth_form/auth_form.js
@@ -0,0 +1,26 @@
+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',
+ render (createElement) {
+ return createElement('component', { is: this.authForm })
+ },
+ 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