/var/www/p4ela.net/www/wp-content/plugins/image-optimization/modules/connect/components
Edit: /var/www/p4ela.net/www/wp-content/plugins/image-optimization/modules/connect/components/handler.php (1758B)
should_handle_auth_code() ) {
return;
}
$code = sanitize_text_field( $_GET['code'] );
$state = sanitize_text_field( $_GET['state'] );
// Check if the state is valid
$this->validate_nonce( $state );
// Exchange the code for an access token and store it
Service::get_token( GrantTypes::AUTHORIZATION_CODE, $code );
// Makes sure we won't stick in the mismatch limbo
Data::set_home_url();
// Redirect to the redirect URI
wp_redirect( Utils::get_redirect_uri() );
exit;
}
/**
* Handler constructor.
*/
public function __construct() {
add_action( 'admin_init', [ $this, 'handle_auth_code' ] );
}
}