[account] don't show captcha until email has been modified

This commit is contained in:
Andrea 2022-03-31 19:37:28 +02:00
parent 204a67f2ce
commit 0513dd2cdb
1 changed files with 10 additions and 2 deletions

View File

@ -97,8 +97,8 @@
<div v-if="!changeEmailAuthId" class="">
<input type="email" class="form-control mb-3" v-model="email" required/>
<div class="d-flex flex-column flex-md-row">
<Captcha v-model="captchaToken"/>
<div class="d-none d-md-block ms-3">
<Captcha v-if="showCaptcha" v-model="captchaToken"/>
<div :class="['d-none', 'd-md-block', showCaptcha ? 'ms-3' : '']">
<button class="btn btn-outline-primary" :disabled="!canChangeEmail">
<T>user.account.changeEmail.action</T>
</button>
@ -208,6 +208,7 @@
gravatar,
showCaptcha: false,
captchaToken: null,
universalDomains: process.env.ALL_LOCALES_URLS.split(',').filter(x => x !== process.env.BASE_URL),
@ -353,6 +354,13 @@
return this.email && this.captchaToken;
}
},
watch: {
email(v) {
if (v !== this.$user().email) {
this.showCaptcha = true;
}
}
}
}
</script>