wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
741 stars 719 forks source link

'Resend code' API returns status code as 201 even at failure case. #9550

Open Pushpalanka opened 3 years ago

Pushpalanka commented 3 years ago

Describe the issue: Even if the resend code API failed to send the code in an attempt it returns 201 as the HTTP status code. Expected it will indicate a failure.

How to reproduce: Call the resend API for an unsupported scenario.

Expected behavior: Provide an indication of the error status in the HTTP status code.

Code - https://github.com/wso2-extensions/identity-governance/blob/master/components/org.wso2.carbon.identity.user.endpoint/src/main/java/org/wso2/carbon/identity/user/endpoint/impl/ResendCodeApiServiceImpl.java#L66-L67

Pushpalanka commented 3 years ago

Fixed with https://github.com/wso2-extensions/identity-governance/pull/431 Need to improve to identify and address the 400 bad request case separately.