diff --git a/wp-includes/rest-api/auth/class-wp-rest-key-pair.php b/wp-includes/rest-api/auth/class-wp-rest-key-pair.php index df47258..fa8b734 100644 --- a/wp-includes/rest-api/auth/class-wp-rest-key-pair.php +++ b/wp-includes/rest-api/auth/class-wp-rest-key-pair.php @@ -94,6 +94,7 @@ public function register_routes() { $args = array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'generate_key_pair' ), + 'permission_callback' => '__return_true', 'args' => array( 'name' => array( 'description' => esc_html__( 'The name of the key-pair.', 'jwt-auth' ), @@ -117,6 +118,7 @@ public function register_routes() { $args = array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_all_key_pairs' ), + 'permission_callback' => '__return_true', 'args' => array( 'user_id' => array( 'description' => esc_html__( 'The ID of the user.', 'jwt-auth' ), @@ -132,6 +134,7 @@ public function register_routes() { $args = array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_key_pair' ), + 'permission_callback' => '__return_true', 'args' => array( 'user_id' => array( 'description' => esc_html__( 'The ID of the user.', 'jwt-auth' ), diff --git a/wp-includes/rest-api/auth/class-wp-rest-token.php b/wp-includes/rest-api/auth/class-wp-rest-token.php index b51ecb6..e9b4ac0 100644 --- a/wp-includes/rest-api/auth/class-wp-rest-token.php +++ b/wp-includes/rest-api/auth/class-wp-rest-token.php @@ -100,12 +100,14 @@ public function register_routes() { $args = array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'validate' ), + 'permission_callback' => '__return_true', ); register_rest_route( self::_NAMESPACE_, '/' . self::_REST_BASE_ . '/validate', $args ); $args = array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'generate_token' ), + 'permission_callback' => '__return_true', 'args' => array( 'api_key' => array( 'description' => __( 'The API key of the user; requires also setting the api_secret.', 'jwt-auth' ),