Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change password through update, unclear error message #270

Open
TetianaPerinha opened this issue Apr 17, 2024 · 1 comment
Open

Change password through update, unclear error message #270

TetianaPerinha opened this issue Apr 17, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers medium priority Medium priority issue

Comments

@TetianaPerinha
Copy link
Collaborator

TetianaPerinha commented Apr 17, 2024

Description: When a user tries to update a password that does not meet requirements(Password must be at least 8 characters long and contain at least one letter, one digit, and may include special characters @$!%*?&), the system should return a clear error message that explains the password requirements easily. However, the app displays a regular expression that is hard to understand.

Preconditions:
User is registered and the bearer token is obtained.

Steps to Reproduce:
replace the token with valid data

Execute the following CURL command to attempt to update the user password:
curl --location --request PATCH 'http://0.0.0.0:8083/api/v1/users'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer {token}'
--data '{
"newPassword": "password",
"oldPassword": "password12345"
}'
Observe the response.
Expected Result:

The system should reject the "newPassword" containing only letters.
HTTP status code 400 (Bad Request) should be returned.
Error message should clearly state: { "message": "Password must be at least 8 characters long and contain at least one letter, one digit, and may include special characters @$!%*?&" }.
Actual Result:

The "newPassword" field is correctly rejected for not meeting the requirement.
HTTP status code - 400.
The error message provided is unclear and technical: "message": "[{ ErrorMessage: must match "^(?=.[A-Za-z])(?=.\d)[A-Za-z\d@$!%*?&]{8,}$" }]".

image
image

@TetianaPerinha TetianaPerinha added bug Something isn't working good first issue Good for newcomers medium priority Medium priority issue labels Apr 17, 2024
@TetianaPerinha TetianaPerinha changed the title Update password, unclear error message Change password through update, unclear error message Apr 17, 2024
@anmol797
Copy link

Hi @TetianaPerinha can i contribute here ? BTW I am new to open source contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers medium priority Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants