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

bug: update password route (PUT) responses are inconsistent #94

Open
jamalnay opened this issue Dec 7, 2023 · 1 comment
Open

bug: update password route (PUT) responses are inconsistent #94

jamalnay opened this issue Dec 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jamalnay
Copy link

jamalnay commented Dec 7, 2023

Bug Report

Plugin Version

3.5.3

WordPress Version

6.4.2

Bug description

When sending a PUT request (to update a password) to the reset password route (/simple-jwt-login/v1/user/reset_password) the response is not consistent. when the code provided by the user (which is the code sent by the same route with a POST request) is correct I got a response in the format:

{
    "success": true,
    "message": "User Password has been changed."
}

but when the code entered by the user is incorrect I got a response in the format :

{
"success": false,
    "data": {
        "message": "Invalid code provided.",
        "errorCode": 62
    }
}

What did you expect to happen? What actually happened?
As you can see, I got tow different responses for the same request with different params, if the code is correct I got a response, but if it is incorrect I got a different response. As a developer I will expect the same response with different params, having different responses will make my work hard by building on an unpredictable responses..
-->

@jamalnay jamalnay added the bug Something isn't working label Dec 7, 2023
@jamalnay
Copy link
Author

jamalnay commented Dec 7, 2023

It turned out that the HTTP response code is not the same, if the code is incorrect I got an HTTP response code of 400 (bad request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant