Search in sources :

Example 1 with ResetCodeResponse

use of org.wso2.carbon.identity.rest.api.user.recovery.v1.model.ResetCodeResponse in project identity-api-user by wso2.

the class PasswordRecoveryService method buildResetCodeResponse.

/**
 * Build the ResetCodeResponse for successful confirmation code validation.
 *
 * @param tenantDomain         Tenant Domain
 * @param passwordResetCodeDTO {@link PasswordResetCodeDTO}PasswordResetCodeDTO
 * @return ResetCodeResponseDTO {@link ResetCodeResponse}object with a password reset code
 */
private ResetCodeResponse buildResetCodeResponse(String tenantDomain, PasswordResetCodeDTO passwordResetCodeDTO) {
    // Build next API calls list.
    ArrayList<APICall> apiCallsArrayList = new ArrayList<>();
    apiCallsArrayList.add(RecoveryUtil.buildApiCall(Constants.APICall.RESET_PASSWORD_API.getType(), Constants.RelationStates.NEXT_REL, RecoveryUtil.buildURIForBody(tenantDomain, Constants.APICall.RESET_PASSWORD_API.getApiUrl(), Constants.ACCOUNT_RECOVERY_ENDPOINT_BASEPATH), null));
    ResetCodeResponse resetCodeResponseDTO = new ResetCodeResponse();
    resetCodeResponseDTO.setResetCode(passwordResetCodeDTO.getPasswordResetCode());
    resetCodeResponseDTO.setLinks(apiCallsArrayList);
    return resetCodeResponseDTO;
}
Also used : ResetCodeResponse(org.wso2.carbon.identity.rest.api.user.recovery.v1.model.ResetCodeResponse) APICall(org.wso2.carbon.identity.rest.api.user.recovery.v1.model.APICall) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 APICall (org.wso2.carbon.identity.rest.api.user.recovery.v1.model.APICall)1 ResetCodeResponse (org.wso2.carbon.identity.rest.api.user.recovery.v1.model.ResetCodeResponse)1