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)