Describe the bug
When a username does not meet formatting requirements, for example by having spaces in it, the following error message is displayed to the user
1 validation error detected: Value at 'username' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A user friendly error message should be displayed
Username cannot contain spaces
All possible errors should have a user friendly message. The regular expression message should be reserved for documentation.
I see the same problem when a user tries to sign in and accidentally types a trailing space after their email address:
2 validation errors detected: Value '[email protected] ' at 'userName' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+; Value '[email protected] ' at 'userAlias' failed to satisfy constraint: Member must satisfy regular expression pattern: [\p{L}\p{M}\p{S}\p{N}\p{P}]+
My proposal to make it better:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@finnbear @kennu We are merging a change to render a more human readable error. Trimming the input is an appropriate change as well, but I would rather roll that up into a larger change.
Describe the bug
I am still seeing the behaviour described by kennu when a user leaves a trailing space after their user name.
To Reproduce
Attempt to log in using Amplify UI with a trailing space after username.
Desired behaviour
Present the user with a more user friendly error message.

Most helpful comment
I see the same problem when a user tries to sign in and accidentally types a trailing space after their email address:
My proposal to make it better: