@akinon/next 1.81.0-rc.0 → 1.81.0-rc.2
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 +8 -0
- package/middlewares/url-redirection.ts +16 -0
- package/package.json +2 -2
- package/types/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -60,6 +60,22 @@ const withUrlRedirection =
|
|
|
60
60
|
|
|
61
61
|
const setCookies = request.headers.getSetCookie();
|
|
62
62
|
|
|
63
|
+
if (settings.commerceRedirectionIgnoreList) {
|
|
64
|
+
const shouldIgnoreRedirect =
|
|
65
|
+
settings.commerceRedirectionIgnoreList.some((ignorePath) =>
|
|
66
|
+
redirectUrl.pathname.startsWith(
|
|
67
|
+
getUrlPathWithLocale(
|
|
68
|
+
ignorePath,
|
|
69
|
+
req.middlewareParams.rewrites.locale
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
if (shouldIgnoreRedirect) {
|
|
75
|
+
return middleware(req, event);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
63
79
|
const response = NextResponse.redirect(redirectUrl.toString(), {
|
|
64
80
|
status: request.status
|
|
65
81
|
});
|
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.81.0-rc.
|
|
4
|
+
"version": "1.81.0-rc.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"set-cookie-parser": "2.6.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@akinon/eslint-plugin-projectzero": "1.81.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.81.0-rc.2",
|
|
34
34
|
"@types/react-redux": "7.1.30",
|
|
35
35
|
"@types/set-cookie-parser": "2.4.7",
|
|
36
36
|
"@typescript-eslint/eslint-plugin": "6.7.4",
|
package/types/index.ts
CHANGED
|
@@ -203,6 +203,7 @@ export interface Settings {
|
|
|
203
203
|
useOptimizedTranslations?: boolean;
|
|
204
204
|
plugins?: Record<string, Record<string, any>>;
|
|
205
205
|
includedProxyHeaders?: string[];
|
|
206
|
+
commerceRedirectionIgnoreList?: string[];
|
|
206
207
|
/**
|
|
207
208
|
* By default, the currency will be reset when the currency is changed.
|
|
208
209
|
* If you want to keep the basket when the currency is changed, you can set this option to `false`.
|