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
})
const accountActivationRequired = metadata.accountActivationRequired
store.dispatch('setInstanceOption', { name: 'accountActivationRequired', value: accountActivationRequired })
const accounts = metadata.staffAccounts
resolveStaffAccounts({ store, accounts })
} else {

View file

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