make email validation conditional work

This commit is contained in:
Shpuld Shpuldson 2020-05-04 12:56:39 +03:00
parent 101eebb40b
commit f7f8a579fa

View file

@ -14,9 +14,10 @@ const registration = {
},
captcha: {}
}),
validations: {
validations () {
return {
user: {
email: requiredIf('accountActivationRequired'),
email: { required: requiredIf(() => this.accountActivationRequired) },
username: { required },
fullname: { required },
password: { required },
@ -25,6 +26,7 @@ const registration = {
sameAsPassword: sameAs('password')
}
}
}
},
created () {
if ((!this.registrationOpen && !this.token) || this.signedIn) {
@ -43,7 +45,8 @@ const registration = {
signedIn: (state) => !!state.users.currentUser,
isPending: (state) => state.users.signUpPending,
serverValidationErrors: (state) => state.users.signUpErrors,
termsOfService: (state) => state.instance.tos
termsOfService: (state) => state.instance.tos,
accountActivationRequired: (state) => state.instance.accountActivationRequired
})
},
methods: {