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/routing/settings.php

    r13980 r14070  
    1313        $this->old_current_user = get_current_user_id();
    1414        $this->permalink_structure = get_option( 'permalink_structure', '' );
    15         self::set_current_user( self::factory()->user->create( array( 'role' => 'subscriber' ) ) );
     15        wp_set_current_user( self::factory()->user->create( array( 'role' => 'subscriber' ) ) );
    1616    }
    1717
    1818    public function tear_down() {
    19         self::set_current_user( $this->old_current_user );
     19        wp_set_current_user( $this->old_current_user );
    2020        $this->set_permalink_structure( $this->permalink_structure );
    2121
Note: See TracChangeset for help on using the changeset viewer.