First attempt at not requiring email address for registration

This commit is contained in:
Mark Felder 2020-02-24 11:19:00 -06:00
parent d19c64314f
commit 86561592d0
2 changed files with 10 additions and 2 deletions

View File

@ -241,6 +241,9 @@ const getNodeInfo = async ({ store }) => {
: federation.enabled : federation.enabled
}) })
const accountActivationRequired = metadata.accountActivationRequired
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })
const accounts = metadata.staffAccounts const accounts = metadata.staffAccounts
resolveStaffAccounts({ store, accounts }) resolveStaffAccounts({ store, accounts })
} else { } else {

View File

@ -1,5 +1,5 @@
import { validationMixin } from 'vuelidate' import { validationMixin } from 'vuelidate'
import { required, sameAs } from 'vuelidate/lib/validators' import { required, requiredIf, sameAs } from 'vuelidate/lib/validators'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
const registration = { const registration = {
@ -16,7 +16,7 @@ const registration = {
}), }),
validations: { validations: {
user: { user: {
email: { required }, email: requiredIf('accountActivationRequired'),
username: { required }, username: { required },
fullname: { required }, fullname: { required },
password: { required }, password: { required },
@ -24,6 +24,11 @@ const registration = {
required, required,
sameAsPassword: sameAs('password') sameAsPassword: sameAs('password')
} }
},
nested: {
required: requiredIf(function (nestedModel) {
return this.accountActivationRequired
})
} }
}, },
created () { created () {