@akinon/next 1.79.0-rc.4 → 1.79.0-rc.6
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 +12 -0
- package/api/auth.ts +2 -0
- package/data/client/user.ts +16 -8
- package/package.json +2 -2
- package/types/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @akinon/next
|
|
2
2
|
|
|
3
|
+
## 1.79.0-rc.6
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0200d568: ZERO-3163: Add frontendIds property to Settings interface
|
|
8
|
+
|
|
9
|
+
## 1.79.0-rc.5
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 778aabf8: ZERO-3163: Add frontend ID header to authentication requests and forgot password mutation
|
|
14
|
+
|
|
3
15
|
## 1.79.0-rc.4
|
|
4
16
|
|
|
5
17
|
## 1.79.0-rc.3
|
package/api/auth.ts
CHANGED
|
@@ -92,6 +92,8 @@ const nextAuthOptions = (req: NextApiRequest, res: NextApiResponse) => {
|
|
|
92
92
|
req.headers['x-app-device']?.toString() ?? ''
|
|
93
93
|
);
|
|
94
94
|
|
|
95
|
+
headers.set('x-frontend-id', req.cookies['pz-frontend-id'] || '');
|
|
96
|
+
|
|
95
97
|
logger.debug('Trying to login/register', {
|
|
96
98
|
formType: credentials.formType,
|
|
97
99
|
userIp
|
package/data/client/user.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { api } from './api';
|
|
2
2
|
import { user } from '../urls';
|
|
3
3
|
import { ForgotPasswordFormType, Order } from '../../types';
|
|
4
|
-
import { buildClientRequestUrl } from '../../utils';
|
|
4
|
+
import { buildClientRequestUrl, getCookie } from '../../utils';
|
|
5
5
|
|
|
6
6
|
interface GetCaptchaResponse {
|
|
7
7
|
siteKey: string;
|
|
@@ -64,13 +64,21 @@ const userApi = api.injectEndpoints({
|
|
|
64
64
|
})
|
|
65
65
|
}),
|
|
66
66
|
forgotPassword: build.mutation<void, ForgotPasswordFormType>({
|
|
67
|
-
query: (body) =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
query: (body) => {
|
|
68
|
+
const frontendId = getCookie('pz-frontend-id');
|
|
69
|
+
const headers = frontendId
|
|
70
|
+
? { 'x-frontend-id': frontendId }
|
|
71
|
+
: undefined;
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
url: buildClientRequestUrl(user.forgotPassword, {
|
|
75
|
+
contentType: 'application/json'
|
|
76
|
+
}),
|
|
77
|
+
method: 'POST',
|
|
78
|
+
body,
|
|
79
|
+
headers
|
|
80
|
+
};
|
|
81
|
+
}
|
|
74
82
|
}),
|
|
75
83
|
otpLogin: build.mutation<void, { phone: string }>({
|
|
76
84
|
query: ({ phone }) => ({
|
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.79.0-rc.
|
|
4
|
+
"version": "1.79.0-rc.6",
|
|
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.79.0-rc.
|
|
33
|
+
"@akinon/eslint-plugin-projectzero": "1.79.0-rc.6",
|
|
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
|
@@ -208,6 +208,7 @@ export interface Settings {
|
|
|
208
208
|
* If you want to keep the basket when the currency is changed, you can set this option to `false`.
|
|
209
209
|
*/
|
|
210
210
|
resetBasketOnCurrencyChange?: boolean;
|
|
211
|
+
frontendIds?: Record<string, number>;
|
|
211
212
|
}
|
|
212
213
|
|
|
213
214
|
export interface CacheOptions {
|