diff --git a/class.jetpack-xmlrpc-server.php b/class.jetpack-xmlrpc-server.php index f1d6a493f46ad..988782e5030ce 100644 --- a/class.jetpack-xmlrpc-server.php +++ b/class.jetpack-xmlrpc-server.php @@ -300,7 +300,7 @@ function test_api_user_code( $args ) { error_log( "VERIFY: $verify" ); */ - $jetpack_token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER ); + $jetpack_token = Jetpack_Data::get_access_token( $user_id ); $api_user_code = get_user_meta( $user_id, "jetpack_json_api_$client_id", true ); if ( !$api_user_code ) { @@ -326,7 +326,7 @@ function test_api_user_code( $args ) { * @return boolean */ function disconnect_blog() { - + // For tracking if ( ! empty( $this->user->ID ) ) { wp_set_current_user( $this->user->ID ); diff --git a/class.jetpack.php b/class.jetpack.php index e2abaf2208b23..3231528d92983 100644 --- a/class.jetpack.php +++ b/class.jetpack.php @@ -5290,7 +5290,8 @@ function verify_json_api_authorization_request( $environment = null ) { ? $_REQUEST : $environment; - $token = Jetpack_Data::get_access_token( JETPACK_MASTER_USER ); + list( $envToken, $envVersion, $envUserId ) = explode( ':', $environment['token'] ); + $token = Jetpack_Data::get_access_token( $envUserId ); if ( ! $token || empty( $token->secret ) ) { wp_die( __( 'You must connect your Jetpack plugin to WordPress.com to use this feature.' , 'jetpack' ) ); }