From 48721c85ebcfa973ee81719d2467ca80e4253dc9 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 01 May 2026 17:30:03 +0000
Subject: [PATCH] =Edmonton Ink hard test begins! Real testing of the managers and reset routes will commence. So far, just ensuring our classes are all loaded correctly: Site() and its sub-classes Membership, Login, etc. Care should be taken to load conditionally on 'init', as we finish defining most settings by 'plugins_loaded' at priority 5

---
 assets/js/concise/AuthManager.js |   19 ++++---------------
 1 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/assets/js/concise/AuthManager.js b/assets/js/concise/AuthManager.js
index 033255e..3d8c381 100644
--- a/assets/js/concise/AuthManager.js
+++ b/assets/js/concise/AuthManager.js
@@ -17,8 +17,8 @@
 		this.nonces = {};
 
 		this.subscribers = new Set();
-		this.storageKey = 'jvb_auth_state';
-		this.cacheMetaKey = 'jvb_auth_meta';
+		this.storageKey = `${jvbBase.base}auth_state`;
+		this.cacheMetaKey = `${jvbBase.base}auth_meta`;
 		this.cacheExpiry = 5 * 60 * 1000; // 5 minutes
 
 		this.init();
@@ -29,21 +29,12 @@
 	 */
 	async init() {
 		if (this.isAuthenticating) {
-			// Wait for existing auth to complete
-			return new Promise(resolve => {
-				const checkAuth = setInterval(() => {
-					if (this.initialized) {
-						clearInterval(checkAuth);
-						resolve();
-					}
-				}, 50);
-			});
+			return this.ready();
 		}
 
 		this.isAuthenticating = true;
 
 		try {
-			// Check if we have cached auth and cookie hasn't changed
 			const cached = this.getCachedAuth();
 			if (cached) {
 				this.setAuthData(cached);
@@ -53,7 +44,6 @@
 				return;
 			}
 
-			// Fetch fresh auth data
 			await this.fetchAuth();
 
 		} catch (error) {
@@ -96,13 +86,12 @@
 				headers
 			});
 
-			// If auth failed and we haven't retried yet, refresh and try once more
 			if ((response.status === 403 || response.status === 401) && retryCount === 0) {
 				const result = await response.clone().json();
 				if (result.code === 'rest_cookie_invalid_nonce' || result.message?.includes('Cookie check')) {
 					console.log('Nonce invalid, refreshing auth...');
 					await this.refresh();
-					return attempt(1); // Retry once
+					return attempt(1);
 				}
 			}
 

--
Gitblit v1.10.0