@akinon/next 1.79.0-rc.3 → 1.79.0-rc.5
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/api/auth.ts +2 -0
- package/data/client/user.ts +16 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
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.5",
|
|
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.5",
|
|
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",
|