quidproquo-actionprocessor-awslambda 0.0.247 → 0.0.249
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/lib/commonjs/getActionProcessor/core/userDirectory/getUserDirectoryChangePasswordActionProcessor.js +2 -2
- package/lib/commonjs/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js +3 -3
- package/lib/esm/getActionProcessor/core/userDirectory/getUserDirectoryChangePasswordActionProcessor.js +2 -2
- package/lib/esm/lambdaHandlers/getCloudFrontRequestEvent_viewerRequest.js +2 -2
- package/package.json +5 -5
|
@@ -14,9 +14,9 @@ const quidproquo_config_aws_1 = require("quidproquo-config-aws");
|
|
|
14
14
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
15
15
|
const changePassword_1 = require("../../../logic/cognito/changePassword");
|
|
16
16
|
const getProcessChangePassword = (qpqConfig) => {
|
|
17
|
-
return ({ oldPassword, newPassword }
|
|
17
|
+
return ({ oldPassword, newPassword, accessToken }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
18
|
const region = quidproquo_config_aws_1.qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
19
|
-
yield (0, changePassword_1.changePassword)(
|
|
19
|
+
yield (0, changePassword_1.changePassword)(accessToken, oldPassword, newPassword, region);
|
|
20
20
|
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
21
21
|
});
|
|
22
22
|
};
|
|
@@ -12,11 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.getCloudFrontRequestEvent_viewerRequest = exports.viewerRequestEventHandler = void 0;
|
|
13
13
|
const quidproquo_webserver_1 = require("quidproquo-webserver");
|
|
14
14
|
const viewerRequestEventHandler = (event, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
16
16
|
console.log(JSON.stringify(event));
|
|
17
17
|
const request = event.Records[0].cf.request;
|
|
18
|
-
const headers = request.headers;
|
|
19
|
-
const userAgent = ((_a = headers['user-agent'][0]) === null ||
|
|
18
|
+
const headers = request.headers || {};
|
|
19
|
+
const userAgent = ((_b = (_a = headers['user-agent']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.value) || 'unknown';
|
|
20
20
|
// let isBot = userAgent.match(/bot|crawl|spider|slurp|facebot|facebookexternalhit/i);
|
|
21
21
|
// Bot testing for integrating Prerender ~ you then do what you want inside the app business logic
|
|
22
22
|
// For more info: https://docs.prerender.io/docs/apache-2
|
|
@@ -2,9 +2,9 @@ import { qpqConfigAwsUtils } from 'quidproquo-config-aws';
|
|
|
2
2
|
import { actionResult, UserDirectoryActionType, } from 'quidproquo-core';
|
|
3
3
|
import { changePassword } from '../../../logic/cognito/changePassword';
|
|
4
4
|
const getProcessChangePassword = (qpqConfig) => {
|
|
5
|
-
return async ({ oldPassword, newPassword }
|
|
5
|
+
return async ({ oldPassword, newPassword, accessToken }) => {
|
|
6
6
|
const region = qpqConfigAwsUtils.getApplicationModuleDeployRegion(qpqConfig);
|
|
7
|
-
await changePassword(
|
|
7
|
+
await changePassword(accessToken, oldPassword, newPassword, region);
|
|
8
8
|
return actionResult(void 0);
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -2,8 +2,8 @@ import { qpqHeaderIsBot } from 'quidproquo-webserver';
|
|
|
2
2
|
export const viewerRequestEventHandler = async (event, context) => {
|
|
3
3
|
console.log(JSON.stringify(event));
|
|
4
4
|
const request = event.Records[0].cf.request;
|
|
5
|
-
const headers = request.headers;
|
|
6
|
-
const userAgent = headers['user-agent'][0]?.value || 'unknown';
|
|
5
|
+
const headers = request.headers || {};
|
|
6
|
+
const userAgent = headers['user-agent']?.[0]?.value || 'unknown';
|
|
7
7
|
// let isBot = userAgent.match(/bot|crawl|spider|slurp|facebot|facebookexternalhit/i);
|
|
8
8
|
// Bot testing for integrating Prerender ~ you then do what you want inside the app business logic
|
|
9
9
|
// For more info: https://docs.prerender.io/docs/apache-2
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-awslambda",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.249",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"lodash": "^4.17.21",
|
|
56
56
|
"node-cache": "^5.1.2",
|
|
57
57
|
"node-match-path": "^0.6.3",
|
|
58
|
-
"quidproquo-config-aws": "0.0.
|
|
59
|
-
"quidproquo-core": "0.0.
|
|
60
|
-
"quidproquo-webserver": "0.0.
|
|
58
|
+
"quidproquo-config-aws": "0.0.249",
|
|
59
|
+
"quidproquo-core": "0.0.249",
|
|
60
|
+
"quidproquo-webserver": "0.0.249"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/aws-lambda": "^8.10.109",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/jsonwebtoken": "^9.0.2",
|
|
66
66
|
"@types/lodash": "^4.14.194",
|
|
67
67
|
"@types/node": "^18.11.9",
|
|
68
|
-
"quidproquo-tsconfig": "0.0.
|
|
68
|
+
"quidproquo-tsconfig": "0.0.249",
|
|
69
69
|
"typescript": "^4.9.3"
|
|
70
70
|
}
|
|
71
71
|
}
|