+ Your session has expired for security reasons. Please log in again to continue.
+
+
+
+
+
+
) => {
+ const response = await originalFetch(...args);
+ if (response.status === 401) {
+ const hadToken =
+ typeof sessionStorage !== 'undefined' &&
+ Boolean(sessionStorage.getItem('nxtgauge_admin_access_token'));
+ // Only treat this as a session expiry if we were actually holding a token —
+ // otherwise this is just a normal pre-login 401 (e.g. a failed login attempt).
+ if (hadToken) markSessionExpired();
+ }
+ return response;
+ };
+}