Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2024 06:19:06 PM (13 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/messages/template.php

    r13980 r14070  
    281281        // set user to anonymous
    282282        $old_current_user = get_current_user_id();
    283         self::set_current_user( 0 );
     283        wp_set_current_user( 0 );
    284284
    285285        // now, do the message thread query
     
    291291        $this->assertEmpty( $messages_template->threads );
    292292
    293         self::set_current_user( $old_current_user );
     293        wp_set_current_user( $old_current_user );
    294294    }
    295295
     
    462462        // set $u1 as current user.
    463463        $old_current_user = get_current_user_id();
    464         self::set_current_user( $u1 );
     464        wp_set_current_user( $u1 );
    465465
    466466        $messages_template = new BP_Messages_Box_Template(
     
    471471        );
    472472
    473         self::set_current_user( $old_current_user );
     473        wp_set_current_user( $old_current_user );
    474474
    475475        $thread = reset( $messages_template->threads );
Note: See TracChangeset for help on using the changeset viewer.