diff --git a/src/core/components/recaptcha/core-recaptcha.html b/src/core/components/recaptcha/core-recaptcha.html index 102ddefc2..3e96f751d 100644 --- a/src/core/components/recaptcha/core-recaptcha.html +++ b/src/core/components/recaptcha/core-recaptcha.html @@ -7,7 +7,10 @@ {{ 'core.answered' | translate }} - + {{ 'core.login.recaptchaexpired' | translate }} + + {{ 'core.required' | translate }} + diff --git a/src/core/components/recaptcha/recaptcha.ts b/src/core/components/recaptcha/recaptcha.ts index fb6e1f260..ef4608f4a 100644 --- a/src/core/components/recaptcha/recaptcha.ts +++ b/src/core/components/recaptcha/recaptcha.ts @@ -32,6 +32,7 @@ export class CoreRecaptchaComponent implements OnInit { @Input() publicKey?: string; // The site public key. @Input() modelValueName = 'recaptcharesponse'; // Name of the model property where to store the response. @Input() siteUrl = ''; // The site URL. If not defined, current site. + @Input() showRequiredError = false; // Whether to display the required error if recaptcha hasn't been answered. expired = false; diff --git a/src/core/features/login/pages/email-signup/email-signup.html b/src/core/features/login/pages/email-signup/email-signup.html index b1bafd6f5..3ef4627f0 100644 --- a/src/core/features/login/pages/email-signup/email-signup.html +++ b/src/core/features/login/pages/email-signup/email-signup.html @@ -186,7 +186,8 @@

{{ 'core.login.security_question' | translate }}

- + diff --git a/src/core/features/login/pages/email-signup/email-signup.ts b/src/core/features/login/pages/email-signup/email-signup.ts index 253d20fdc..f0d0f3f3f 100644 --- a/src/core/features/login/pages/email-signup/email-signup.ts +++ b/src/core/features/login/pages/email-signup/email-signup.ts @@ -60,6 +60,7 @@ export class CoreLoginEmailSignupPage implements OnInit { settingsLoaded = false; allRequiredSupported = true; signupUrl?: string; + formSubmitClicked = false; captcha = { recaptcharesponse: '', }; @@ -265,6 +266,8 @@ export class CoreLoginEmailSignupPage implements OnInit { e.preventDefault(); e.stopPropagation(); + this.formSubmitClicked = true; + if (!this.signupForm.valid || (this.settings?.recaptchapublickey && !this.captcha.recaptcharesponse)) { // Form not valid. Mark all controls as dirty to display errors. for (const name in this.signupForm.controls) {