getgrav / grav-plugin-admin

Grav Admin Plugin
http://getgrav.org
MIT License
355 stars 223 forks source link

Username does not pass the minimum requirements #2354

Open ppo opened 1 year ago

ppo commented 1 year ago

What does that mean!?! What am I doing wrong?
Please write useful error messages!

I've that error on the initial page/form to create the admin account after having installed this plugin.

No field (especially not the username) is marked as wrong/error.

I tried first with something like abc.def in the username, then with abc-def. Both produce that error. Then finally abcdefghij worked.

Funny thing, creating a new user via the admin panel works fine with abc.def. The validation process/rules are apparently not centralized.

bitstarr commented 10 months ago

The default requirement for usernames does not allow period as character. It should allow a dash though, which I tested positively right now. https://github.com/getgrav/grav/blob/develop/system/config/system.yaml#L10C18-L10C18

But you got a good a point in poor error hightlighting in the form. We should also find a way to translate a Regex statement into a human readable text to give the error message more context.

Also I could reproduce the issue that the form in admin/accounts/users/:add is not addressing the system username_regex.