I am using AWS Amplify in two of my applications. In the first one, we used aws-amplify v3.0.23 without Amplify-UI. It shows the following error message if username contains a space:
Value at 'username' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+
However, in my other application, where we are using aws-amplify/ui-react v1.2.4 with aws-amplify v4.1.2, it shows a more user-friendly message in the same case:
Username cannot contain whitespace
Right now, I am trying to upgrade to the latest versions of aws-amplify and aws-amplify/ui-react i.e., v4.3.15 and v2.8.0 respectively because Amplify-ui v1.2.4 does not support password managers like Last Pass. But, I see that the latest version again shows the message "Value at 'username' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+" instead of the user-friendly message "Username cannot contain whitespace" in case username contains a space. Is there any way in AWS Amplify or AWS Cognito to override the validation messages?