diff --git a/lib/class-wp-rest-oauth1.php b/lib/class-wp-rest-oauth1.php index d95e060..1d5cbdd 100644 --- a/lib/class-wp-rest-oauth1.php +++ b/lib/class-wp-rest-oauth1.php @@ -221,6 +221,8 @@ public function get_authentication_errors( $value ) { return $value; } + $this->authenticate( null ); + return $this->auth_status; } diff --git a/oauth-server.php b/oauth-server.php index 6793853..de5ed48 100644 --- a/oauth-server.php +++ b/oauth-server.php @@ -74,7 +74,6 @@ function rest_oauth1_load() { global $wp_json_authentication_oauth1; $wp_json_authentication_oauth1 = new WP_REST_OAuth1(); - add_filter( 'determine_current_user', array( $wp_json_authentication_oauth1, 'authenticate' ) ); add_filter( 'rest_authentication_errors', array( $wp_json_authentication_oauth1, 'get_authentication_errors' ) ); } add_action( 'init', 'rest_oauth1_load' );