Different Error Messages if Password Not Long Enough
Closed this issue · 5 comments
If you are trying to create a user in first subaccount of kapua-sys (e.g. account0) you get error message as shown in Screenshot no. 1.
But if you create a subaccount of accoun0 (e.g. account0_1) and do not meet the minimum requirements for password length, the error message is totally different (screenshot No. 2)
Testflow:
- Login as kapua-sys
- Go to Accounts, create an account (e.g. account0)
- Select account0, go to Account settings, change password.min.lenght to e.g. 20
- Try to create a user with password shorter than 20 - observe the error (screenshot no. 1)
- Create a subaccount of account0, e.g. account0_1.
- in account0_1 set the min password to e.g. 25, try to create a user within account0_1 with password shorter than 25
- Observe the error message - it is different than the upper one.
Expected behavior
Error messages hould be the same.
Version of Kapua
https://github.com/lorthirk/kapua/tree/feature-configurablePasswordLength
Type of deployment
[ ] Local Vagrant deployment
[x] Docker
[ ] Openshift (in its variants)
[ ] Others
Main component affected
[x] Console (in case of console please report info on which browser you encountered the problem)
[ ] REST API -> did not try rest api!!! -> please check!
[ ] Message Broker
[ ] - Others
Hey, now the only message that shows is "The minimum length for this field is (number)". -> Is this the desired message? If yes, then this is resolved. I personally liked the first one better "The specified password does not meat...", because is more "polite", but this one can also do the trick 😄
Yes, because "The specified password does not meet..." comes from the backend, while "The minimum length for this field is..." comes from the frontend. As per #14, the validation is now on the frontend because it must happen before the request reaches the backend, otherwise we would have the user created but not the credential.
I am closing this issue due to upper comment. Technically both error messages are not the same, so from UI standpoint the issue is resolved.