Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/03/2024 06:19:06 PM (22 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/class.bp-messages-thread.php

    r13980 r14070  
    572572                // Mark thread as read
    573573                $current_user = get_current_user_id();
    574                 self::set_current_user( $u2 );
     574                wp_set_current_user( $u2 );
    575575                messages_mark_thread_read( $t1 );
    576576
     
    578578                $this->assertFalse( wp_cache_get( 'thread_recipients_' . $t1, 'bp_messages' ) );
    579579
    580                 self::set_current_user( $current_user );
     580                wp_set_current_user( $current_user );
    581581        }
    582582
     
    674674                // Mark thread as unread
    675675                $current_user = get_current_user_id();
    676                 self::set_current_user( $u2 );
     676                wp_set_current_user( $u2 );
    677677                messages_mark_thread_unread( $t1 );
    678678
     
    680680                $this->assertFalse( wp_cache_get( 'thread_recipients_' . $t1, 'bp_messages' ) );
    681681
    682                 self::set_current_user( $current_user );
     682                wp_set_current_user( $current_user );
    683683        }
    684684
Note: See TracChangeset for help on using the changeset viewer.