From 3d25ad7de4fdbb3eba2cde2a62422e6be5d79a0a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 25 Aug 2026 22:57:22 +0000
Subject: [PATCH] =It's been a minute. I went through the Routes and associated Managers and ensured they played together well. Reworked the Cache.php, and I think I caught all the references. Moving away from JVBase() root class, to individuall classes that are Instanced. Double checked for the ABSPATH check in every file, and added index.php to every directory that didn't already have it. Also still working on the MenuBlock to work with WooCommerce for now for Northeh

---
 inc/integrations/OAuth.php |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/inc/integrations/OAuth.php b/inc/integrations/OAuth.php
index dcf89aa..df742fa 100644
--- a/inc/integrations/OAuth.php
+++ b/inc/integrations/OAuth.php
@@ -10,7 +10,7 @@
 
 trait OAuth
 {
-	use _Base, Admin;
+	use _Base, Admin, ServiceMap;
 	protected OAuthURLs $oauth;
 	/**
 	 * Child classes must set this (e.g. 'https://api.example.com/v1/')
@@ -38,6 +38,10 @@
 	{
 		return $this->getRequestHeaders();
 	}
+	public function getOAuthBaseURL():?string
+	{
+		return $this->baseOAuthUrl;
+	}
 
 	/**
 	 * Default to the base handleResponse method, but extensions can modify accordingly
@@ -291,12 +295,14 @@
 		}
 
 		// Get integration instance
-		$integration = JVB()->connect($this->service_name, $user_id);
+		$integration = $this->getService($this->service_name);
 
-		if (!$integration) {
+		if (!$integration || !method_exists($integration, 'switchUser')) {
 			wp_die('Invalid service: ' . esc_html($this->service_name), 'OAuth Error');
 		}
 
+		$integration->switchUser($user_id);
+
 
 		// Exchange code for tokens
 		$result = $integration->handleOAuthCode($code, $state);

--
Gitblit v1.10.0