@tramvai/module-cookie 1.66.1 → 1.70.0
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/lib/browser.js +4 -12
- package/lib/cookieManager.browser.d.ts +1 -3
- package/package.json +4 -4
package/lib/browser.js
CHANGED
|
@@ -53,11 +53,12 @@ class CookiesFallback {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
class CookieManager {
|
|
56
|
-
constructor(
|
|
56
|
+
constructor() {
|
|
57
|
+
const isSecure = window.location.protocol === 'https:';
|
|
57
58
|
this.cookies = checkCookieEnabled()
|
|
58
59
|
? new Cookies({
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
sameSite: isSecure ? 'none' : 'lax',
|
|
61
|
+
secure: isSecure,
|
|
61
62
|
})
|
|
62
63
|
: new CookiesFallback();
|
|
63
64
|
}
|
|
@@ -97,15 +98,6 @@ CookieModule = __decorate([
|
|
|
97
98
|
provide: COOKIE_MANAGER_TOKEN,
|
|
98
99
|
useClass: CookieManager,
|
|
99
100
|
scope: Scope.SINGLETON,
|
|
100
|
-
deps: {
|
|
101
|
-
// cookieOptions позволяет переопределить SameSite=Lax на None для фикса проблем с iframe
|
|
102
|
-
// TODO после успешного тестирования в приложении paymentsext, убрать прокидывание cookieOptions
|
|
103
|
-
// и установить SameSite=None по умолчанию
|
|
104
|
-
cookieOptions: {
|
|
105
|
-
token: 'temporary cookieOptions',
|
|
106
|
-
optional: true,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
101
|
},
|
|
110
102
|
],
|
|
111
103
|
})
|
|
@@ -2,9 +2,7 @@ import type { CookieOptions } from '@tinkoff/browser-cookies';
|
|
|
2
2
|
import type { CookieManager as Interface, CookieSetOptions } from './tokens';
|
|
3
3
|
export declare class CookieManager implements Interface {
|
|
4
4
|
private cookies;
|
|
5
|
-
constructor(
|
|
6
|
-
cookieOptions?: CookieOptions;
|
|
7
|
-
});
|
|
5
|
+
constructor();
|
|
8
6
|
get(name: string): string;
|
|
9
7
|
set({ name, value, noSubdomains, ...options }: CookieSetOptions): void;
|
|
10
8
|
all(): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-cookie",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.70.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@tinkoff/utils": "^2.1.2",
|
|
27
|
-
"@tramvai/core": "1.
|
|
28
|
-
"@tramvai/state": "1.
|
|
29
|
-
"@tramvai/tokens-common": "1.
|
|
27
|
+
"@tramvai/core": "1.70.0",
|
|
28
|
+
"@tramvai/state": "1.70.0",
|
|
29
|
+
"@tramvai/tokens-common": "1.70.0",
|
|
30
30
|
"@tinkoff/dippy": "0.7.38",
|
|
31
31
|
"tslib": "^2.0.3"
|
|
32
32
|
},
|