lorthirk/kapua

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:

  1. Login as kapua-sys
  2. Go to Accounts, create an account (e.g. account0)
  3. Select account0, go to Account settings, change password.min.lenght to e.g. 20
  4. Try to create a user with password shorter than 20 - observe the error (screenshot no. 1)
  5. Create a subaccount of account0, e.g. account0_1.
  6. in account0_1 set the min password to e.g. 25, try to create a user within account0_1 with password shorter than 25
  7. Observe the error message - it is different than the upper one.

Expected behavior
Error messages hould be the same.

Screenshot No. 1:
Screenshot 2020-10-29 at 08 02 03

Screenshot No. 2:
Screenshot 2020-10-29 at 08 00 52

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

This also happens when you try to change a password of a user:

Screenshot 2020-10-29 at 09 52 16

This could be related to #14. Could you please check it again?

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.