@visns-studio/visns-components 6.5.0 → 6.5.2

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.0",
94
+ "version": "6.5.2",
95
95
  "description": "Various packages to assist in the development of our Custom Applications.",
96
96
  "main": "src/index.js",
97
97
  "files": [
@@ -121,6 +121,13 @@ const GenericAuth = ({
121
121
  const [isClientAuthenticated, setIsClientAuthenticated] = useState(false);
122
122
 
123
123
  const updateAuthStatus = async () => {
124
+ // Guards must not act while the profile check is in flight: after a
125
+ // login flips isAuthenticated this re-runs, and a route evaluated
126
+ // against the half-updated state bounced dashboard → /login →
127
+ // dashboard. Loading renders AuthLoading instead, so the user sees
128
+ // one spinner and one navigation.
129
+ setIsLoading(true);
130
+
124
131
  try {
125
132
  const { data } = await CustomFetch('/ajax/user/profile', 'GET');
126
133
 
@@ -135,7 +142,15 @@ const GenericAuth = ({
135
142
  }
136
143
  } catch (error) {
137
144
  setIsLoading(false);
138
- if (['Unauthenticatdata.'].includes(error)) {
145
+ // Was `'Unauthenticatdata.'` — a typo no server response ever
146
+ // matches, so this redirect had been dead code since it was
147
+ // written and unauthenticated bounces were left to the route
148
+ // guard alone.
149
+ if (
150
+ ['Unauthenticated.', 'CSRF token mismatch.'].includes(
151
+ String(error)
152
+ )
153
+ ) {
139
154
  const currentUrl = window.location.pathname;
140
155
 
141
156
  setIsAuthenticated(false);
@@ -707,7 +707,10 @@
707
707
  .logo {
708
708
  width: 100%;
709
709
  position: relative;
710
- background: rgba(var(--tertiary-color-rgb), 0.95);
710
+ /* Near-white by default (the rendering every project has today).
711
+ A project whose page background is the same colour can merge the
712
+ plate into the rail instead: `--nav-logo-bg: var(--nav-bg)`. */
713
+ background: var(--nav-logo-bg, rgba(var(--tertiary-color-rgb), 0.95));
711
714
  height: 50px;
712
715
  display: flex;
713
716
  flex-wrap: nowrap;
@@ -963,6 +966,11 @@
963
966
  outline: none;
964
967
  border-radius: var(--br);
965
968
  font: inherit;
969
+ /* Stated after the `font` shorthand: the nav rows above take
970
+ these from the shared `.app-nav` rule, and a footer that sets
971
+ neither reads two sizes larger than the list it footers. */
972
+ font-size: var(--nav-item-font-size, var(--font-size-sm, 0.8125rem));
973
+ font-weight: var(--font-weight-medium, 500);
966
974
  cursor: pointer;
967
975
  appearance: none;
968
976
  transition: all 0.65s cubic-bezier(0.25, 0.8, 0.25, 1);