Skip to content

Commit

Permalink
Merge pull request #822 from PlanoramaEvents/development
Browse files Browse the repository at this point in the history
3.1 RC for testing
  • Loading branch information
balen authored Apr 22, 2023
2 parents 4f0c47f + 40f288a commit 3f348e8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions app/javascript/login/create_account.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
></email-field>
<div class="d-flex mb-2" v-if="captchaKey">
<vue-recaptcha
ref="recaptcha"
ref="recaptcha"
:sitekey="captchaKey"
:loadRecaptchaScript="true"
@verify="onVerifyCaptcha"
@expired="onCaptchaError"
@error="onCaptchaError"
></vue-recaptcha>
</div>
Expand Down Expand Up @@ -73,22 +74,29 @@ export default {
validate: null,
},
},
captcha_response: null,
captcha_errored: false
}),
components: {
EmailField,
VueRecaptcha
},
computed: {
submitDisabled: function () {
return this.form.email.valid === false;
if (this.currentSettings.recaptcha_site_key) {
return this.captcha_errored || this.captcha_response == null || this.form.email.valid === false
} else {
console.log('submitDisabled: check email')
return this.form.email.valid === false;
}
},
captchaKey: function() {
return this.currentSettings.recaptcha_site_key
}
},
methods: {
onVerifyCaptcha: function (response) {
// console.log('Verify: ' + response)
console.log('Verify: ' + response)
this.captcha_response = response;
this.captcha_errored = false;
},
Expand All @@ -98,16 +106,12 @@ export default {
},
onSubmit: async function (event) {
event.preventDefault();
if (this.currentSettings.recaptcha_site_key && this.captcha_errored) {
this.alert.text = VALID_CAPTCHA_REQUIRED;
this.alert.visible = true;
return;
}
await validateFields(this.form.email);
if (this.form.email.valid === false) {
this.error.text = LOGIN_INVALID_FIELDS;
this.error.visible = true;
// This does not do anything @gail - verify
// this.error.text = LOGIN_INVALID_FIELDS;
// this.error.visible = true;
} else {
// We need the URL of the destination if any that the user is going to be sent to
// This would, for example, be the survey
Expand Down Expand Up @@ -146,10 +150,6 @@ export default {
});
}
},
},
mounted() {
this.captcha_response = null;
this.captcha_errored = false;
}
};
</script>

0 comments on commit 3f348e8

Please sign in to comment.