• Resolved strarsis

    (@strarsis)


    Great plugin. But it interferes with the REST API authentication:

    
    function only_allow_logged_in_rest_access( $access ) {
    
            if( ! is_user_logged_in() ) {
                return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'coming-soon' ), array( 'status' => rest_authorization_required_code() ) );
            }
    
            return $access;
            
        }
    

    It doesn’t check for $access being NULL, because then another auth method already has decided. This prevents other auth methods to be used, when no logged in user is involved (like API key auth, and others).

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Interferes with REST API’ is closed to new replies.