@akinon/next 1.92.0-rc.12 → 1.92.0-rc.13
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/CHANGELOG.md +6 -0
- package/package.json +2 -2
- package/utils/index.ts +11 -7
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.92.0-rc.
|
|
4
|
+
"version": "1.92.0-rc.13",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"set-cookie-parser": "2.6.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.
|
|
37
|
+
"@akinon/eslint-plugin-projectzero": "1.92.0-rc.13",
|
|
38
38
|
"@babel/core": "7.26.10",
|
|
39
39
|
"@babel/preset-env": "7.26.9",
|
|
40
40
|
"@babel/preset-typescript": "7.27.0",
|
package/utils/index.ts
CHANGED
|
@@ -28,16 +28,20 @@ export function setCookie(name: string, value: string) {
|
|
|
28
28
|
localeUrlStrategy === LocaleUrlStrategy.Subdomain
|
|
29
29
|
? getRootHostname(hostname)
|
|
30
30
|
: null;
|
|
31
|
-
const domainStr = domain ? `Domain=${domain}
|
|
32
|
-
const expiryDate = new Date();
|
|
33
|
-
|
|
31
|
+
const domainStr = domain ? `Domain=${domain}` : '';
|
|
32
|
+
const expiryDate = new Date(Date.now() + WEEK_IN_MS);
|
|
33
|
+
const isSecure = hostname.startsWith('https://');
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const cookieParts = [
|
|
36
36
|
`${name}=${value}`,
|
|
37
|
-
`
|
|
38
|
-
`
|
|
37
|
+
`Eexpires=${expiryDate.toUTCString()}`,
|
|
38
|
+
`Path=/`,
|
|
39
|
+
`SameSite=lax`,
|
|
40
|
+
`Secure=${isSecure}`,
|
|
39
41
|
domainStr
|
|
40
|
-
].
|
|
42
|
+
].filter(Boolean);
|
|
43
|
+
|
|
44
|
+
const cookieString = cookieParts.join('; ');
|
|
41
45
|
|
|
42
46
|
document.cookie = cookieString;
|
|
43
47
|
}
|