Skip to content

Commit e516ae8

Browse files
author
Andrea Barbasso
committed
[CST-15593] go back to orejime-anonymous cookie
1 parent 0ab4d90 commit e516ae8

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

cypress/support/e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ before(() => {
5454

5555
// Runs once before the first test in each "block"
5656
beforeEach(() => {
57-
// Pre-agree to all Orejime cookies by setting the orejime cookie
57+
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
5858
// This just ensures it doesn't get in the way of matching other objects in the page.
59-
cy.setCookie('orejime', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
59+
cy.setCookie('orejime-anonymous', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
6060

6161
// Remove any CSRF cookies saved from prior tests
6262
cy.clearCookie(DSPACE_XSRF_COOKIE);

src/app/core/google-recaptcha/google-recaptcha.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class GoogleRecaptchaService {
105105
tap(([recaptchaVersionRD, recaptchaModeRD, recaptchaKeyRD]) => {
106106

107107
if (
108-
this.cookieService.get('orejime') && this.cookieService.get('orejime')[CAPTCHA_NAME] &&
108+
this.cookieService.get('orejime-anonymous') && this.cookieService.get('orejime-anonymous')[CAPTCHA_NAME] &&
109109
recaptchaKeyRD.hasSucceeded && recaptchaVersionRD.hasSucceeded &&
110110
isNotEmpty(recaptchaVersionRD.payload?.values) && isNotEmpty(recaptchaKeyRD.payload?.values)
111111
) {

src/app/register-email-form/register-email-form.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit {
247247
* Return true if the user has accepted the required cookies for reCaptcha
248248
*/
249249
isRecaptchaCookieAccepted(): boolean {
250-
const orejimeAnonymousCookie = this.cookieService.get('orejime');
250+
const orejimeAnonymousCookie = this.cookieService.get('orejime-anonymous');
251251
return isNotEmpty(orejimeAnonymousCookie) ? orejimeAnonymousCookie[CAPTCHA_NAME] : false;
252252
}
253253

src/app/shared/cookies/orejime-configuration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { NativeWindowRef } from '../../core/services/window.service';
1515
*/
1616
export const HAS_AGREED_END_USER = 'dsHasAgreedEndUser';
1717

18-
export const ANONYMOUS_STORAGE_NAME_OREJIME = 'orejime';
18+
export const ANONYMOUS_STORAGE_NAME_OREJIME = 'orejime-anonymous';
1919

2020
export const GOOGLE_ANALYTICS_OREJIME_KEY = 'google-analytics';
2121

@@ -26,7 +26,7 @@ export const GOOGLE_ANALYTICS_OREJIME_KEY = 'google-analytics';
2626

2727
export function getOrejimeConfiguration(_window: NativeWindowRef): any {
2828
return {
29-
storageName: ANONYMOUS_STORAGE_NAME_OREJIME,
29+
cookieName: ANONYMOUS_STORAGE_NAME_OREJIME,
3030

3131
privacyPolicy: './info/privacy',
3232

0 commit comments

Comments
 (0)