@akinon/next 1.60.0-rc.7 → 1.60.0-rc.9

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.60.0-rc.9
4
+
5
+ ### Minor Changes
6
+
7
+ - ad5de2c: ZERO-2949: Add currency and language headers to format=json request
8
+
9
+ ## 1.60.0-rc.8
10
+
11
+ ### Minor Changes
12
+
13
+ - 57d1657: ZERO-2925: Update condation
14
+
3
15
  ## 1.60.0-rc.7
4
16
 
5
17
  ## 1.60.0-rc.6
@@ -37,6 +37,12 @@ const withPzDefault =
37
37
  // Support legacy ?format=json query param
38
38
  if (searchParams.has('json') || searchParams.get('format') === 'json') {
39
39
  try {
40
+ const { locales } = Settings.localization;
41
+ const locale = req.cookies.get('pz-locale')?.value;
42
+ const selectedLanguageValue = locales.find(
43
+ (l) => l.value === locale
44
+ )?.apiValue;
45
+
40
46
  searchParams.set('format', 'json');
41
47
 
42
48
  const request = await fetch(
@@ -51,7 +57,9 @@ const withPzDefault =
51
57
  headers: {
52
58
  Cookie: req.headers.get('cookie') || '',
53
59
  Accept: 'application/json',
54
- 'X-Requested-With': 'XMLHttpRequest'
60
+ 'X-Requested-With': 'XMLHttpRequest',
61
+ 'x-currency': req.cookies.get('pz-currency')?.value ?? '',
62
+ 'Accept-Language': selectedLanguageValue ?? ''
55
63
  }
56
64
  }
57
65
  );
@@ -60,7 +60,10 @@ const withOauthLogin =
60
60
 
61
61
  const currentSessionId = req.cookies.get('osessionid');
62
62
 
63
- if (req.cookies.get('messages')?.value.includes('Successfully signed in') || currentSessionId) {
63
+ if (
64
+ req.cookies.get('messages')?.value.includes('Successfully signed in') ||
65
+ (currentSessionId && req.cookies.get('messages'))
66
+ ) {
64
67
  let redirectUrlWithLocale = `${url.origin}${getUrlPathWithLocale(
65
68
  '/auth/oauth-login',
66
69
  req.cookies.get('pz-locale')?.value
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.60.0-rc.7",
4
+ "version": "1.60.0-rc.9",
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.60.0-rc.7",
33
+ "@akinon/eslint-plugin-projectzero": "1.60.0-rc.9",
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",