From b1b536b5d2aa19a2967466acc90a6547955b8595 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 10 Feb 2017 15:33:07 -0200 Subject: [PATCH] Give REST API authentication a lower priority Bigger than add_filter( 'determine_current_user', 'wp_validate_auth_cookie' ); Smaller than add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 ); This solve issues while trying to authenticate in a browser while logged in. Closes #13134 --- includes/api/class-wc-rest-authentication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/api/class-wc-rest-authentication.php b/includes/api/class-wc-rest-authentication.php index e4ea1d553c20..57331dc5ca3a 100644 --- a/includes/api/class-wc-rest-authentication.php +++ b/includes/api/class-wc-rest-authentication.php @@ -18,7 +18,7 @@ class WC_REST_Authentication { * Initialize authentication actions. */ public function __construct() { - add_filter( 'determine_current_user', array( $this, 'authenticate' ), 100 ); + add_filter( 'determine_current_user', array( $this, 'authenticate' ), 15 ); add_filter( 'rest_authentication_errors', array( $this, 'check_authentication_error' ) ); add_filter( 'rest_post_dispatch', array( $this, 'send_unauthorized_headers' ), 50 ); }