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/class-bp-button.php

    r13980 r14070  
    2424    public function test_block_self_own_profile() {
    2525        $u = self::factory()->user->create();
    26         self::set_current_user( $u );
     26        wp_set_current_user( $u );
    2727        $this->set_permalink_structure( '/%postname%/' );
    2828
     
    4343    public function test_block_self_others_profile() {
    4444        $u1 = self::factory()->user->create();
    45         self::set_current_user( $u1 );
     45        wp_set_current_user( $u1 );
    4646        $this->set_permalink_structure( '/%postname%/' );
    4747
     
    7070        ) );
    7171
    72         self::set_current_user( $u1 );
     72        wp_set_current_user( $u1 );
    7373
    7474        $found = array();
     
    110110        ) );
    111111
    112         self::set_current_user( $u1 );
     112        wp_set_current_user( $u1 );
    113113
    114114        $found = array();
     
    150150        ) );
    151151
    152         self::set_current_user( $u1 );
     152        wp_set_current_user( $u1 );
    153153        $this->set_permalink_structure( '/%postname%/' );
    154154        $this->go_to( bp_members_get_user_url( $u1 ) );
Note: See TracChangeset for help on using the changeset viewer.