From b38f03c0e7218762d90fa5092696b127f24f36db Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 25 Jan 2026 07:07:26 +0000
Subject: [PATCH] =Some logical flaws in Queue.php, Queue.js, ContentExecutor.php, UploadExecutor.php - particularly with timeline ordering, frontend queue updates, etc

---
 inc/rest/routes/LoginRoutes.php |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/inc/rest/routes/LoginRoutes.php b/inc/rest/routes/LoginRoutes.php
index 226692b..e775960 100644
--- a/inc/rest/routes/LoginRoutes.php
+++ b/inc/rest/routes/LoginRoutes.php
@@ -31,23 +31,7 @@
 		register_rest_route($this->namespace, '/auth/login', [
 			'methods' => 'POST',
 			'callback' => [$this, 'handleLogin'],
-			'permission_callback' => [$this, 'checkRateLimit'],
-			'args' => [
-				'user_email' => [
-					'required' => true,
-					'type' => 'string',
-					'sanitize_callback' => 'sanitize_email'
-				],
-				'user_password' => [
-					'required' => true,
-					'type' => 'string'
-				],
-				'remember_me' => [
-					'required' => false,
-					'type' => 'boolean',
-					'default' => false
-				]
-			]
+			'permission_callback' => [$this, 'checkRateLimit']
 		]);
 
 		// Logout endpoint
@@ -125,7 +109,7 @@
 
 	public function handleLogin(WP_REST_Request $request): WP_REST_Response
 	{
-		$data = $request->get_json_params();
+		$data = $request->get_params();
 		// Verify Turnstile
 		if (!$this->verifyTurnstile($data['cf-turnstile-response'] ?? '')) {
 			return $this->error('Security verification failed', 'turnstile_failed', 403);
@@ -584,7 +568,7 @@
 		];
 	}
 
-	protected function getRedirect(WP_User $user, string $url, string $context = 'login'):string
+	protected function getRedirect(WP_User $user, ?string $url=null, string $context = 'login'):string
 	{
 		if (!empty($url)) {
 			$url = sanitize_url($url);
@@ -665,7 +649,7 @@
 			}
 
 			// Lockout expired - clear attempts
-			$this->cache->delete($cache_key);
+			$this->cache->forget($cache_key);
 			return true;
 		}
 
@@ -705,7 +689,7 @@
 	protected function clearFailedAttempts(string $username): void
 	{
 		$cache_key = 'login_attempts_' . md5($username);
-		$this->cache->delete($cache_key);
+		$this->cache->forget($cache_key);
 	}
 
 

--
Gitblit v1.10.0