Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2024 06:19:06 PM (5 months ago)
Author:
espellcaste
Message:

A user is no longer de-authenticated when making REST API requests.

We are introducing a new BP_LoggedIn_User class to fetch data about a BuddyPress logged-in user. This new addition fixes an issue where a user could be de-authenticated when making REST API requests.

Props dcavins, DJPaul, johnjamesjacoby, and imath.

Closes https://github.com/buddypress/buddypress/pull/395
See #9229 and #9145
Fixes #7658

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/suggestions.php

    r13980 r14070  
    112112    public function set_up() {
    113113        parent::set_up();
    114         self::set_current_user( self::$current_user );
     114        wp_set_current_user( self::$current_user );
    115115    }
    116116
    117117    public function tear_down() {
    118         self::set_current_user( self::$old_user_id );
     118        wp_set_current_user( self::$old_user_id );
    119119        parent::tear_down();
    120120    }
     
    269269
    270270        // "alpaca red" is in the hidden group
    271         self::set_current_user( self::$user_ids['alpaca red'] );
     271        wp_set_current_user( self::$user_ids['alpaca red'] );
    272272        $suggestions = bp_core_get_suggestions( array(
    273273            'group_id' => self::$group_ids['hidden'],
     
    289289
    290290        // "caterpillar" is in the private group
    291         self::set_current_user( self::$user_ids['caterpillar'] );
     291        wp_set_current_user( self::$user_ids['caterpillar'] );
    292292        $suggestions = bp_core_get_suggestions( array(
    293293            'group_id' => self::$group_ids['private'],
     
    328328
    329329
    330         self::set_current_user( self::$user_ids['caterpillar'] );
     330        wp_set_current_user( self::$user_ids['caterpillar'] );
    331331
    332332        // "cat" is in the private group, so won't show up here.
     
    359359
    360360
    361         self::set_current_user( self::$user_ids['alpaca red'] );
     361        wp_set_current_user( self::$user_ids['alpaca red'] );
    362362
    363363        // "alpaca red" is in the hidden group, so won't show up here.
Note: See TracChangeset for help on using the changeset viewer.