[CST-15593] go back to orejime-anonymous cookie

This commit is contained in:
Andrea Barbasso
2024-10-31 11:32:54 +01:00
parent 0ab4d903d9
commit e516ae8653
4 changed files with 6 additions and 6 deletions

View File

@@ -54,9 +54,9 @@ before(() => {
// Runs once before the first test in each "block"
beforeEach(() => {
// Pre-agree to all Orejime cookies by setting the orejime cookie
// Pre-agree to all Orejime cookies by setting the orejime-anonymous cookie
// This just ensures it doesn't get in the way of matching other objects in the page.
cy.setCookie('orejime', '{%22authentication%22:true%2C%22preferences%22:true%2C%22acknowledgement%22:true%2C%22google-analytics%22:true%2C%22google-recaptcha%22:true}');
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}');
// Remove any CSRF cookies saved from prior tests
cy.clearCookie(DSPACE_XSRF_COOKIE);

View File

@@ -105,7 +105,7 @@ export class GoogleRecaptchaService {
tap(([recaptchaVersionRD, recaptchaModeRD, recaptchaKeyRD]) => {
if (
this.cookieService.get('orejime') && this.cookieService.get('orejime')[CAPTCHA_NAME] &&
this.cookieService.get('orejime-anonymous') && this.cookieService.get('orejime-anonymous')[CAPTCHA_NAME] &&
recaptchaKeyRD.hasSucceeded && recaptchaVersionRD.hasSucceeded &&
isNotEmpty(recaptchaVersionRD.payload?.values) && isNotEmpty(recaptchaKeyRD.payload?.values)
) {

View File

@@ -247,7 +247,7 @@ export class RegisterEmailFormComponent implements OnDestroy, OnInit {
* Return true if the user has accepted the required cookies for reCaptcha
*/
isRecaptchaCookieAccepted(): boolean {
const orejimeAnonymousCookie = this.cookieService.get('orejime');
const orejimeAnonymousCookie = this.cookieService.get('orejime-anonymous');
return isNotEmpty(orejimeAnonymousCookie) ? orejimeAnonymousCookie[CAPTCHA_NAME] : false;
}

View File

@@ -15,7 +15,7 @@ import { NativeWindowRef } from '../../core/services/window.service';
*/
export const HAS_AGREED_END_USER = 'dsHasAgreedEndUser';
export const ANONYMOUS_STORAGE_NAME_OREJIME = 'orejime';
export const ANONYMOUS_STORAGE_NAME_OREJIME = 'orejime-anonymous';
export const GOOGLE_ANALYTICS_OREJIME_KEY = 'google-analytics';
@@ -26,7 +26,7 @@ export const GOOGLE_ANALYTICS_OREJIME_KEY = 'google-analytics';
export function getOrejimeConfiguration(_window: NativeWindowRef): any {
return {
storageName: ANONYMOUS_STORAGE_NAME_OREJIME,
cookieName: ANONYMOUS_STORAGE_NAME_OREJIME,
privacyPolicy: './info/privacy',