[CST-6782] Fix

This commit is contained in:
Davide Negretti
2022-09-29 22:07:15 +02:00
parent 614ce4aa83
commit c69934aab6
3 changed files with 4 additions and 4 deletions

View File

@@ -136,7 +136,7 @@ export class GoogleRecaptchaService {
return of(grecaptcha.execute()); return of(grecaptcha.execute());
} }
public getRecaptchaTokenResponse () { public getRecaptchaTokenResponse() {
return grecaptcha.getResponse(); return grecaptcha.getResponse();
} }

View File

@@ -115,7 +115,7 @@ export class RegisterEmailFormComponent implements OnInit {
if (captchaVersion === 'v3') { if (captchaVersion === 'v3') {
return this.googleRecaptchaService.getRecaptchaToken('register_email'); return this.googleRecaptchaService.getRecaptchaToken('register_email');
} else if (captchaVersion === 'v2' && captchaMode === 'checkbox') { } else if (captchaVersion === 'v2' && captchaMode === 'checkbox') {
return this.googleRecaptchaService.getRecaptchaTokenResponse(); return of(this.googleRecaptchaService.getRecaptchaTokenResponse());
} else if (captchaVersion === 'v2' && captchaMode === 'invisible') { } else if (captchaVersion === 'v2' && captchaMode === 'invisible') {
return of(tokenV2); return of(tokenV2);
} else { } else {

View File

@@ -20,7 +20,7 @@ export class GoogleRecaptchaComponent implements OnInit {
*/ */
@Output() executeRecaptcha: EventEmitter<any> = new EventEmitter(); @Output() executeRecaptcha: EventEmitter<any> = new EventEmitter();
@Output() checkboxChecked: EventEmitter<any> = new EventEmitter(); @Output() checkboxChecked: EventEmitter<boolean> = new EventEmitter();
@Output() showNotification: EventEmitter<any> = new EventEmitter(); @Output() showNotification: EventEmitter<any> = new EventEmitter();
@@ -50,7 +50,7 @@ export class GoogleRecaptchaComponent implements OnInit {
this.executeRecaptcha.emit($event); this.executeRecaptcha.emit($event);
break; break;
case 'checkbox': case 'checkbox':
this.checkboxChecked.emit(isNotEmpty($event)); // todo fix con boolean this.checkboxChecked.emit(isNotEmpty($event));
break; break;
default: default:
console.error(`Invalid reCaptcha mode '${this.captchaMode}`); console.error(`Invalid reCaptcha mode '${this.captchaMode}`);