Code Duplication    Length = 7-7 lines in 2 locations

_inc/class.jetpack-provision.php 2 locations

@@ 154-160 (lines=7) @@
151
		$response_code = wp_remote_retrieve_response_code( $result );
152
		$body_json     = json_decode( wp_remote_retrieve_body( $result ) );
153
154
		if( 200 !== $response_code ) {
155
			if ( isset( $body_json->error ) ) {
156
				return new WP_Error( $body_json->error, $body_json->message );
157
			} else {
158
				return new WP_Error( 'server_error', sprintf( __( "Request failed with code %s" ), $response_code ) );
159
			}
160
		}
161
162
		if ( isset( $body_json->access_token ) ) {
163
			// authorize user and enable SSO
@@ 208-214 (lines=7) @@
205
		$response_code = wp_remote_retrieve_response_code( $result );
206
		$body_json     = json_decode( wp_remote_retrieve_body( $result ) );
207
208
		if( 200 !== $response_code ) {
209
			if ( isset( $body_json->error ) ) {
210
				return new WP_Error( $body_json->error, $body_json->message );
211
			} else {
212
				return new WP_Error( 'server_error', sprintf( __( "Request failed with code %s" ), $response_code ) );
213
			}
214
		}
215
216
		return true;
217
	}