@visns-studio/visns-components 6.5.1 → 6.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -91,7 +91,7 @@
91
91
  "react-dom": "^17.0.0 || ^18.0.0"
92
92
  },
93
93
  "name": "@visns-studio/visns-components",
94
- "version": "6.5.1",
94
+ "version": "6.5.3",
95
95
  "description": "Various packages to assist in the development of our Custom Applications.",
96
96
  "main": "src/index.js",
97
97
  "files": [
@@ -147,6 +147,11 @@ const Login = ({
147
147
  window.location.href = result.previous;
148
148
  } else {
149
149
  setSystemAuth(true);
150
+ // Move now, with the profile the server just
151
+ // returned — waiting for the background
152
+ // re-check to navigate leaves the login form
153
+ // on screen for a beat after success.
154
+ navigate('/', { replace: true });
150
155
  }
151
156
  }
152
157
  } else {
@@ -121,6 +121,17 @@ const GenericAuth = ({
121
121
  const [isClientAuthenticated, setIsClientAuthenticated] = useState(false);
122
122
 
123
123
  const updateAuthStatus = async () => {
124
+ // Guards must not act while the FIRST profile check is in flight:
125
+ // evaluated against empty state they bounced dashboard → /login →
126
+ // dashboard after sign-in. But only block when there is no usable
127
+ // profile — raising loading over an already-authenticated tree swaps
128
+ // the whole page for a spinner on every background re-check, which
129
+ // is its own flicker. With a profile in hand the re-check is
130
+ // invisible.
131
+ if (!userProfile.id) {
132
+ setIsLoading(true);
133
+ }
134
+
124
135
  try {
125
136
  const { data } = await CustomFetch('/ajax/user/profile', 'GET');
126
137
 
@@ -135,7 +146,15 @@ const GenericAuth = ({
135
146
  }
136
147
  } catch (error) {
137
148
  setIsLoading(false);
138
- if (['Unauthenticatdata.'].includes(error)) {
149
+ // Was `'Unauthenticatdata.'` — a typo no server response ever
150
+ // matches, so this redirect had been dead code since it was
151
+ // written and unauthenticated bounces were left to the route
152
+ // guard alone.
153
+ if (
154
+ ['Unauthenticated.', 'CSRF token mismatch.'].includes(
155
+ String(error)
156
+ )
157
+ ) {
139
158
  const currentUrl = window.location.pathname;
140
159
 
141
160
  setIsAuthenticated(false);
@@ -888,6 +888,15 @@
888
888
  display: flex;
889
889
  flex-direction: column;
890
890
 
891
+ /* The rail is `position: fixed` with no z-index, so its notification /
892
+ switch-account panels — stacked inside it — lost to the content's own
893
+ contexts (grid dropdowns sit at 1000+) and painted underneath the
894
+ page. Desktop only: above the content chrome, below modal overlays.
895
+ The ≤1024px drawer keeps its own 600-under-the-header stacking. */
896
+ @media (min-width: 1025px) {
897
+ z-index: 1050;
898
+ }
899
+
891
900
  /* The rail clips itself so a long nav list can't spill; the panels that
892
901
  open from the action rows — the notification list, the account
893
902
  switcher — would be cut off by that. The nav list keeps its own