From 3f7c10b1742ac64a03e5da1968b928afe317ea5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Zori=C4=87?= Date: Tue, 27 Aug 2024 14:00:24 +0200 Subject: [PATCH] fix(api-security-cognito): type of the object key --- packages/api-security-cognito/src/syncWithCognito.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/api-security-cognito/src/syncWithCognito.ts b/packages/api-security-cognito/src/syncWithCognito.ts index 10c73758833..17de544c202 100644 --- a/packages/api-security-cognito/src/syncWithCognito.ts +++ b/packages/api-security-cognito/src/syncWithCognito.ts @@ -162,7 +162,9 @@ export const syncWithCognito = ({ adminUsers.onUserAfterUpdate.subscribe(async ({ originalUser, updatedUser, inputData }) => { const newAttributes = Object.keys(updateAttributes).map(attr => { - const mappedAttr = updateAttributes[attr] as MappedAttrType; + const mappedAttr = updateAttributes[ + attr as keyof typeof updateAttributes + ] as MappedAttrType; const attrValue = typeof mappedAttr === "function" ? mappedAttr(updatedUser)