From fff721dd185f5b97f7ae7a6e64189e55887ff590 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 05 Jul 2026 18:36:57 +0000
Subject: [PATCH] =Cleaning up the Square integration (still a bit more to do yet). Also majorly overhauled /rest/ files to ignore a rest request 'user' paramater, and rely on get_current_user_id() instead.

---
 inc/rest/routes/SettingsRoutes.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/inc/rest/routes/SettingsRoutes.php b/inc/rest/routes/SettingsRoutes.php
index 26b77ea..66d1068 100644
--- a/inc/rest/routes/SettingsRoutes.php
+++ b/inc/rest/routes/SettingsRoutes.php
@@ -51,10 +51,9 @@
     {
 
         $data = $request->get_params();
-		error_log('User: '.print_r($data['user'], true));
-        error_log('Settings routes data: '.print_r($data, true));
-        $user_id = absint($data['user']??0);
-        if ($user_id === 0) {
+
+        $user_id = get_current_user_id();
+        if (!$user_id) {
             return $this->unauthorized();
         }
 
@@ -145,6 +144,7 @@
             }
             $this->cache->flush();
         }
+
         return [
             'success'   => true,
             'result'   => $results,

--
Gitblit v1.10.0