@openhi/constructs 0.0.144 → 0.0.145
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/{chunk-UT7ADSEJ.mjs → chunk-AOSEKL7U.mjs} +15 -8
- package/lib/chunk-AOSEKL7U.mjs.map +1 -0
- package/lib/pre-token-generation.handler.js +14 -7
- package/lib/pre-token-generation.handler.js.map +1 -1
- package/lib/pre-token-generation.handler.mjs +1 -1
- package/lib/provision-default-workspace.handler.js +14 -7
- package/lib/provision-default-workspace.handler.js.map +1 -1
- package/lib/provision-default-workspace.handler.mjs +1 -1
- package/lib/rest-api-lambda.handler.js +14 -7
- package/lib/rest-api-lambda.handler.js.map +1 -1
- package/lib/rest-api-lambda.handler.mjs +1 -1
- package/package.json +3 -3
- package/lib/chunk-UT7ADSEJ.mjs.map +0 -1
|
@@ -7639,16 +7639,23 @@ function getCognitoSubFromRequest(req) {
|
|
|
7639
7639
|
async function findUserBySubOperation(params) {
|
|
7640
7640
|
const { cognitoSub, tableName } = params;
|
|
7641
7641
|
const service = getDynamoControlService(tableName);
|
|
7642
|
-
const
|
|
7643
|
-
const
|
|
7644
|
-
if (!
|
|
7642
|
+
const indexResult = await service.entities.user.query.gsi2({ cognitoSub }).go({ limit: 1, attributes: ["id"] });
|
|
7643
|
+
const indexItem = indexResult.data?.[0];
|
|
7644
|
+
if (!indexItem) {
|
|
7645
|
+
return void 0;
|
|
7646
|
+
}
|
|
7647
|
+
const canonical = await service.entities.user.get({ id: indexItem.id, sk: "CURRENT" }).go();
|
|
7648
|
+
const row = canonical.data;
|
|
7649
|
+
if (!row) {
|
|
7645
7650
|
return void 0;
|
|
7646
7651
|
}
|
|
7647
7652
|
return {
|
|
7648
|
-
id:
|
|
7649
|
-
cognitoSub:
|
|
7650
|
-
resource:
|
|
7651
|
-
|
|
7653
|
+
id: row.id,
|
|
7654
|
+
cognitoSub: row.cognitoSub,
|
|
7655
|
+
resource: row.resource,
|
|
7656
|
+
summary: row.summary,
|
|
7657
|
+
vid: row.vid,
|
|
7658
|
+
lastUpdated: row.lastUpdated
|
|
7652
7659
|
};
|
|
7653
7660
|
}
|
|
7654
7661
|
|