| @@ -446,12 +446,18 @@ | ||
| 446 | 446 | * |
| 447 | 447 | * @return WP_REST_Response |
| 448 | 448 | */ |
| 449 | 449 | public function get_all_users_sessions( WP_REST_Request $request ): WP_REST_Response { |
| 450 | + global $wpdb; | |
| 451 | + | |
| 450 | 452 | $auth_service = AuthService::instance(); |
| 451 | 453 | |
| 452 | 454 | // Get all users who have refresh tokens. |
| 453 | - $user_ids = $auth_service->sessions()->users_with_sessions(); | |
| 455 | + $user_ids = $wpdb->get_col( | |
| 456 | + "SELECT DISTINCT user_id | |
| 457 | + FROM {$wpdb->usermeta} | |
| 458 | + WHERE meta_key = '_woocommerce_pos_refresh_tokens'" | |
| 459 | + ); | |
| 454 | 460 | |
| 455 | 461 | $users_data = array(); |
| 456 | 462 | |
| 457 | 463 | // Get current JTI if available from the request token. |