Jake Vanderwerf
2026-09-18 a6413da67a4579866f0fd0323ddb23a7b6b9654a
inc/rest/routes/IntegrationsRoutes.php
@@ -58,19 +58,16 @@
      $theUserID = current_user_can('manage_options') ? null : get_current_user_id();
      if ($theUserID === false) {
         error_log('User not logged in');
         return $this->validationError(['message' => 'Not logged in']);
      }
      $integration = $this->getService($service);
      if (!method_exists($integration, 'switchUser')) {
         return $this->validationError(['message' => 'Cannot get user integration']);
      }
      $integration = $this->getServiceUser($service, $theUserID);
      if (!$integration || !method_exists($integration, 'processAction')) {
         error_log('No processAction method');
         return $this->validationError(['message'=>'Invalid service']);
      }
      $integration->switchUser($theUserID);
      $integration->getCredentials();
      // Handle the action
@@ -86,6 +83,7 @@
         return $this->success($result);
      } catch (Exception $e) {
         error_log(print_r($e->getMessage(), true));
         return $this->error($e->getMessage());
      }
   }