lock
lock copied to clipboard
Username field on the lock allows spaces.
Description
We are using the latest version of the lock 11.23.1 and it allows spaces in the username.
Reproduction
Enter a space in the username on the signup screen.
Environment
We are using Angular with the auth0-lock package. Also we are adding addition fields.
Also the documentation does not say it allows spaces https://auth0.com/docs/connections/database/require-username
Thanks for raising @thduttonuk - let us look into it.
@stevehobbsdev I have looked into this more. Its when you have "Use my own database" turned on.
More info When you have completed your migration and not set the Login/Get User scripts to no-op it does not validate using the regex on the username
Thanks for your patience here! I appreciate there's been a long time since we looked into this issue.
I can reproduce this with a custom database. I've noticed from the client setting file that is downloaded when Lock initialized, that the validation rules around username are only transmitted to us if the "Username length" settings are enabled in the dashboard. And to enable those, you have to turn on "Import Users to Auth0":

I am currently querying internally as to whether this is intended behaviour or not.
I heard back from the team internally; this is in fact expected behaviour, but is something they plan on improving. Once they implement that on the server, those validation rules should be picked up by Lock.
I'll close this for now and thanks again for your patience.