@eturnity/eturnity_reusable_components 9.3.1-EPDM-1744.4 → 9.3.1-EPDM-1744.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "9.3.1-EPDM-1744.4",
3
+ "version": "9.3.1-EPDM-1744.5",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -108,11 +108,6 @@
108
108
  ButtonsContainer,
109
109
  },
110
110
  props: {
111
- isEmbedded: {
112
- type: Boolean,
113
- default: false,
114
- required: false,
115
- },
116
111
  isOpen: {
117
112
  type: Boolean,
118
113
  default: false,
@@ -270,7 +265,7 @@
270
265
  } else if (choice === 'save_selected') {
271
266
  Object.assign(categories, this.cookieState)
272
267
  }
273
- saveCookieConsent(categories, this.isEmbedded)
268
+ saveCookieConsent(categories)
274
269
  this.$emit('on-cookie-consent-click')
275
270
  },
276
271
  },
@@ -1,4 +1,4 @@
1
- export function saveCookieConsent(categories, isEmbedded) {
1
+ export function saveCookieConsent(categories) {
2
2
  // Create cookie data object with categories, timestamp, and consent_given
3
3
  const cookieData = {
4
4
  categories,
@@ -14,10 +14,15 @@ export function saveCookieConsent(categories, isEmbedded) {
14
14
  cookieString
15
15
  )}; expires=${expiryDate.toUTCString()}; path=/`
16
16
 
17
- if (isEmbedded && window.location.protocol === 'https:') {
18
- cookieStr += '; sameSite=None; Secure'
19
- } else {
20
- cookieStr += '; sameSite=Lax'
17
+ const isEmbedded = window.self !== window.top
18
+ const isHttps = window.location.protocol === 'https:'
19
+
20
+ const sameSite = (isEmbedded && isHttps) ? 'None' : 'Lax'
21
+ cookieStr += `; sameSite=${sameSite}`
22
+
23
+ // Add Secure flag for HTTPS
24
+ if (isHttps) {
25
+ cookieStr += '; Secure'
21
26
  }
22
27
 
23
28
  document.cookie = cookieStr