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/nav/bpCoreNewSubnavItem.php

    r13980 r14070  
    5050    public function test_site_admin_only() {
    5151        $old_current_user = get_current_user_id();
    52         self::set_current_user( 0 );
     52        wp_set_current_user( 0 );
    5353
    5454        $this->assertFalse( bp_core_new_subnav_item( array(
     
    6161        ) ) );
    6262
    63         self::set_current_user( $old_current_user );
     63        wp_set_current_user( $old_current_user );
    6464    }
    6565
     
    110110        $u = self::factory()->user->create();
    111111        $old_current_user = get_current_user_id();
    112         self::set_current_user( $u );
     112        wp_set_current_user( $u );
    113113
    114114        $url = bp_members_get_user_url(
     
    128128        remove_action( 'bp_setup_nav', array( $this, 'new_nav_hook' ), 0 );
    129129
    130         self::set_current_user( $old_current_user );
     130        wp_set_current_user( $old_current_user );
    131131    }
    132132}
Note: See TracChangeset for help on using the changeset viewer.