Skip to content

Commit 36a60d6

Browse files
Update aws_lambda_powertools/utilities/data_classes/cognito_user_pool_event.py
Co-authored-by: Leandro Damascena <[email protected]> Signed-off-by: Stéphane MENG <[email protected]>
1 parent 61bc637 commit 36a60d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aws_lambda_powertools/utilities/data_classes/cognito_user_pool_event.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1028,15 +1028,15 @@ def user_attributes(self) -> Dict[str, str]:
10281028
return self["request"]["userAttributes"]
10291029

10301030
@property
1031-
def client_metadata(self) -> Optional[Dict[str, str]]:
1031+
def client_metadata(self) -> Dict[str, str]:
10321032
"""One or more key-value pairs that you can provide as custom input to the
10331033
custom email sender Lambda function trigger. To pass this data to your Lambda function,
10341034
you can use the ClientMetadata parameter in the AdminRespondToAuthChallenge and
10351035
RespondToAuthChallenge API actions. Amazon Cognito doesn't include data from the
10361036
ClientMetadata parameter in AdminInitiateAuth and InitiateAuth API operations
10371037
in the request that it passes to the post authentication function.
10381038
"""
1039-
return self["request"].get("clientMetadata")
1039+
return self["request"].get("clientMetadata") or {}
10401040

10411041

10421042
class CustomEmailSenderTriggerEvent(BaseTriggerEvent):

0 commit comments

Comments
 (0)