Skip to content

Commit

Permalink
Give REST API authentication a lower priority
Browse files Browse the repository at this point in the history
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
  • Loading branch information
claudiosanches committed Feb 10, 2017
1 parent b58e26b commit b1b536b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/api/class-wc-rest-authentication.php
Expand Up @@ -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 );
}
Expand Down

0 comments on commit b1b536b

Please sign in to comment.