@sitecore-jss/sitecore-jss-nextjs 21.7.0-canary.74 → 21.7.0-canary.76
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.
|
@@ -52,8 +52,14 @@ class MultisiteMiddleware extends middleware_1.MiddlewareBase {
|
|
|
52
52
|
siteName,
|
|
53
53
|
});
|
|
54
54
|
response = this.rewrite(rewritePath, req, response);
|
|
55
|
+
// default site cookie attributes
|
|
56
|
+
const defaultCookieAttributes = {
|
|
57
|
+
secure: true,
|
|
58
|
+
httpOnly: true,
|
|
59
|
+
sameSite: 'none',
|
|
60
|
+
};
|
|
55
61
|
// Share site name with the following executed middlewares
|
|
56
|
-
response.cookies.set(this.SITE_SYMBOL, siteName);
|
|
62
|
+
response.cookies.set(this.SITE_SYMBOL, siteName, defaultCookieAttributes);
|
|
57
63
|
sitecore_jss_1.debug.multisite('multisite middleware end in %dms: %o', Date.now() - startTimestamp, {
|
|
58
64
|
rewritePath,
|
|
59
65
|
siteName,
|
|
@@ -49,8 +49,14 @@ export class MultisiteMiddleware extends MiddlewareBase {
|
|
|
49
49
|
siteName,
|
|
50
50
|
});
|
|
51
51
|
response = this.rewrite(rewritePath, req, response);
|
|
52
|
+
// default site cookie attributes
|
|
53
|
+
const defaultCookieAttributes = {
|
|
54
|
+
secure: true,
|
|
55
|
+
httpOnly: true,
|
|
56
|
+
sameSite: 'none',
|
|
57
|
+
};
|
|
52
58
|
// Share site name with the following executed middlewares
|
|
53
|
-
response.cookies.set(this.SITE_SYMBOL, siteName);
|
|
59
|
+
response.cookies.set(this.SITE_SYMBOL, siteName, defaultCookieAttributes);
|
|
54
60
|
debug.multisite('multisite middleware end in %dms: %o', Date.now() - startTimestamp, {
|
|
55
61
|
rewritePath,
|
|
56
62
|
siteName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-nextjs",
|
|
3
|
-
"version": "21.7.0-canary.
|
|
3
|
+
"version": "21.7.0-canary.76",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"react-dom": "^18.2.0"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@sitecore-jss/sitecore-jss": "^21.7.0-canary.
|
|
76
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "^21.7.0-canary.
|
|
77
|
-
"@sitecore-jss/sitecore-jss-react": "^21.7.0-canary.
|
|
75
|
+
"@sitecore-jss/sitecore-jss": "^21.7.0-canary.76",
|
|
76
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "^21.7.0-canary.76",
|
|
77
|
+
"@sitecore-jss/sitecore-jss-react": "^21.7.0-canary.76",
|
|
78
78
|
"@vercel/kv": "^0.2.1",
|
|
79
79
|
"node-html-parser": "^6.1.4",
|
|
80
80
|
"prop-types": "^15.8.1",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"description": "",
|
|
85
85
|
"types": "types/index.d.ts",
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "4a772de275d78ceeaaa276773cf4df8f70c623ca",
|
|
87
87
|
"files": [
|
|
88
88
|
"dist",
|
|
89
89
|
"types",
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { NextResponse, NextRequest } from 'next/server';
|
|
2
2
|
import { MiddlewareBase, MiddlewareBaseConfig } from './middleware';
|
|
3
|
+
export type CookieAttributes = {
|
|
4
|
+
/**
|
|
5
|
+
* the Secure attribute of the site cookie
|
|
6
|
+
*/
|
|
7
|
+
secure: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* the HttpOnly attribute of the site cookie
|
|
10
|
+
*/
|
|
11
|
+
httpOnly: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* the SameSite attribute of the site cookie
|
|
14
|
+
*/
|
|
15
|
+
sameSite?: true | false | 'lax' | 'strict' | 'none' | undefined;
|
|
16
|
+
};
|
|
3
17
|
export type MultisiteMiddlewareConfig = Omit<MiddlewareBaseConfig, 'disabled'> & {
|
|
4
18
|
/**
|
|
5
19
|
* Function used to determine if site should be resolved from sc_site cookie when present
|