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

Fix for issue product-is/21659 #231

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Conversation

kumardeepak5
Copy link
Contributor

Purpose

This PR may resolve wso2/product-is#21659

Goals

This PR ensures that a 400 status code is returned instead of a 500 when the API endpoint /recovery/password/recover encounters an invalid channel ID in the request body during account recovery v2.

Behavior After Fix:

Below is the Sample Request & response.
Request [Recover Password with invalid channel Id]

curl --location 'https://localhost:9443/api/users/v2/recovery/password/recover' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <base64 username:password>' \
--data '{
  "recoveryCode": "<recovery-code>",
  "channelId": "<invalid-channel-id>"
}'

Response [Recover Password with invalid channel Id]
Response Code - 400

{
    "code": "UAR-10004",
    "message": "Bad Request",
    "description": "Channel ID does not exist",
    "traceId": "<trace-id>"
}

@jenkins-is-staging
Copy link

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/12007979983

@jenkins-is-staging
Copy link

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/12007979983
Status: success

Copy link

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/12007979983

@sadilchamishka sadilchamishka merged commit 8580d0d into wso2:master Jan 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Account recovery api v2 returns 500 when invalid channel id added in the request body in recovery api call.
3 participants