Skip to content

Commit

Permalink
Remove redundant revoke token
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemd24 committed Jul 3, 2024
1 parent ecefb15 commit b55803b
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/ConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -748,14 +748,6 @@ protected function render_admin_page() {
</td>
</tr>
<?php } ?>
<tr>
<th><label>Revoke WPCOM Partner Access:</label></th>
<td>
<p>
<a class="button" href="<?php echo esc_url( wp_nonce_url( add_query_arg( [ 'action' => 'revoke-wpcom-partner-access' ], $url ), 'revoke-wpcom-partner-access' ) ); ?>">Revoke WPCOM Partner Access</a>
</p>
</td>
</tr>
</table>
<?php wp_nonce_field( 'partner-notification' ); ?>
<input name="page" value="connection-test-admin-page" type="hidden" />
Expand Down Expand Up @@ -889,24 +881,6 @@ protected function handle_actions() {

}

if ( 'revoke-wpcom-partner-access' === $_GET['action'] && check_admin_referer( 'revoke-wpcom-partner-access' ) ) {

$revoke_args = [
'method' => 'DELETE',
'timeout' => 30,
'url' => 'https://public-api.wordpress.com/wpcom/v2/sites/' . Jetpack_Options::get_option( 'id' ) . '/wc/partners/google/revoke-token',
'user_id' => get_current_user_id(),
];

$revoke_response = Client::remote_request( $revoke_args, null );

if ( is_wp_error( $revoke_response ) ) {
$this->response .= $revoke_response->get_error_message();
} else {
$this->response .= wp_remote_retrieve_body( $revoke_response );
}
}

if ( 'disconnect-wp-api' === $_GET['action'] && check_admin_referer( 'disconnect-wp-api' ) ) {
$request = new Request( 'DELETE', '/wc/gla/rest-api/authorize' );
$this->send_rest_request( $request );
Expand Down

0 comments on commit b55803b

Please sign in to comment.