Skip to content

Commit ad4e242

Browse files
Francesco MautoAndrea Barbasso
authored andcommitted
Merged in task/dspace-cris-2024_02_x/DSC-2903 (pull request DSpace#4745)
Task/dspace cris 2024 02 x/DSC-2903 Approved-by: Andrea Barbasso
2 parents dacad4e + 2249083 commit ad4e242

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/app/core/google-recaptcha/google-recaptcha-base.component.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ export abstract class GoogleRecaptchaBaseComponent {
4747
*/
4848
disableUntilChecked = true;
4949

50+
/**
51+
* The captcha cookie name to check for consent in the klaro-anonymous cookie.
52+
* Subclasses can override this to use a different consent key
53+
* (e.g. CAPTCHA_REGISTRATION_NAME for the registration form).
54+
*/
55+
protected captchaCookieName: string = CAPTCHA_FEEDBACK_NAME;
56+
5057
captchaVersion(): Observable<string> {
5158
return this.googleRecaptchaService.captchaVersion();
5259
}
@@ -79,9 +86,9 @@ export abstract class GoogleRecaptchaBaseComponent {
7986
* Return true if the user has accepted the required cookies for reCaptcha
8087
*/
8188
isRecaptchaCookieAccepted(): boolean {
82-
const orejimeAnonymousCookie = this.cookieService.get('orejime-anonymous');
83-
return isNotEmpty(orejimeAnonymousCookie)
84-
? orejimeAnonymousCookie[CAPTCHA_FEEDBACK_NAME]
89+
const klaroAnonymousCookie = this.cookieService.get('klaro-anonymous');
90+
return isNotEmpty(klaroAnonymousCookie)
91+
? klaroAnonymousCookie[this.captchaCookieName]
8592
: false;
8693
}
8794

0 commit comments

Comments
 (0)