varminer-app-header 2.6.3 → 2.6.5

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../src/AppHeader.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAe,MAAM,SAAS,CAAC;AAItD,OAAO,sBAAsB,CAAC;AAQ9B,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA8zBvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../src/AppHeader.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAe,MAAM,SAAS,CAAC;AAItD,OAAO,sBAAsB,CAAC;AAQ9B,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAo1BvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .MuiToolbar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important;min-height:var(--size-header-height,65px)!important;padding-left:15px!important}.MuiToolbar-root,.MuiToolbar-root .MuiButtonBase-root{color:var(--color-brand-primary,var(--color-brand-primary))!important}.MuiToolbar-root .MuiButtonBase-root{margin-right:0}.app-header{flex-shrink:0}.app-header,.app-header .MuiAppBar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important}.app-header .MuiAppBar-root{box-shadow:none!important;left:0;position:fixed!important;right:0;top:0;z-index:var(--size-header-zindex,200)!important}.app-header .MuiPaper-root:only-of-type{border-bottom:1px solid var(--color-border-header,var(--color-border-header));box-shadow:none!important;padding:0!important}.var{color:var(--color-brand-accent,var(--color-brand-accent))!important}.miner,.var{font:500 20px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.miner{color:var(--color-brand-deep-navy,var(--color-brand-deep-navy))!important}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-name{color:var(--color-profile-name,var(--color-brand-primary));font:600 16px/28px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-email{color:var(--color-profile-email,var(--color-text-secondary-alpha));font:400 14px/24px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-decoration:underline}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-role{color:var(--color-profile-role,var(--color-text-muted-alpha));font:400 12px/28px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-transform:uppercase}.account-menu:has(.profile-menu-item) .profile-menu-item{padding:10px 15px 5px}.account-menu:has(.profile-menu-item) .MuiMenu-paper{background:var(--color-menu-bg-gradient,linear-gradient(180deg,var(--color-white),var(--color-selected-row),var(--color-selected-row)));box-shadow:none!important;color:var(--color-menu-text,var(--color-black));margin:0;max-width:var(--size-menu-width,280px);width:var(--size-menu-width,280px)}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root{min-width:40px;padding:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root .MuiAvatar-circular{height:40px;margin-left:-10px;margin-right:0;width:40px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root:first-of-type{margin-top:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root .MuiListItemIcon-root .MuiSvgIcon-root{color:var(--color-brand-primary,var(--color-brand-primary))}
1
+ .MuiToolbar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important;min-height:var(--size-header-height,65px)!important;padding-left:15px!important}.MuiToolbar-root,.MuiToolbar-root .MuiButtonBase-root{color:var(--color-brand-primary,var(--color-brand-primary))!important}.MuiToolbar-root .MuiButtonBase-root{margin-right:0}.app-header{flex-shrink:0}.app-header,.app-header .MuiAppBar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important}.app-header .MuiAppBar-root{box-shadow:none!important;left:0;position:fixed!important;right:0;top:0;z-index:var(--size-header-zindex,200)!important}.app-header .MuiPaper-root:only-of-type{border-bottom:1px solid var(--color-border-header,var(--color-border-header));box-shadow:none!important;padding:0!important}.var{color:var(--color-brand-accent,var(--color-brand-accent))!important}.miner,.var{font:500 20px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.miner{color:var(--color-brand-deep-navy,var(--color-brand-deep-navy))!important}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-name,[id=account-menu]:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-name{color:var(--color-profile-name,var(--color-brand-primary,var(--color-brand-primary)));font:600 16px/28px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-email,[id=account-menu]:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-email{color:var(--color-profile-email,var(--color-text-secondary-alpha,var(--color-text-secondary-alpha)));font:400 14px/24px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-decoration:underline}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-role,[id=account-menu]:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-role{color:var(--color-profile-role,var(--color-text-muted-alpha,var(--color-text-muted-alpha)));font:400 12px/28px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-transform:uppercase}.profile-name{color:var(--color-profile-name,var(--color-brand-primary,var(--color-brand-primary)));font:600 16px/28px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.profile-email{color:var(--color-profile-email,var(--color-text-secondary-alpha,var(--color-text-secondary-alpha)));font:400 14px/24px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-decoration:underline}.profile-role{color:var(--color-profile-role,var(--color-text-muted-alpha,var(--color-text-muted-alpha)));font:400 12px/28px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-transform:uppercase}.account-menu:has(.profile-menu-item) .profile-menu-item,[id=account-menu]:has(.profile-menu-item) .profile-menu-item{padding:10px 15px 5px}.account-menu:has(.profile-menu-item) .MuiMenu-paper,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper{background:var(--color-menu-bg-gradient,linear-gradient(180deg,var(--color-white,var(--color-white)),var(--color-selected-row,var(--color-bg-subtle)),var(--color-selected-row,var(--color-bg-subtle))));box-shadow:none!important;color:var(--color-menu-text,var(--color-black,var(--color-black)));margin:0;max-width:var(--size-menu-width,280px);width:var(--size-menu-width,280px)}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root{min-width:40px;padding:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root .MuiAvatar-circular,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root .MuiAvatar-circular{height:40px;margin-left:-10px;margin-right:0;width:40px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root:first-of-type,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root:first-of-type{margin-top:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root .MuiListItemIcon-root .MuiSvgIcon-root,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root .MuiListItemIcon-root .MuiSvgIcon-root{color:var(--color-brand-primary,var(--color-brand-primary))}
package/dist/index.d.ts CHANGED
@@ -98,7 +98,8 @@ interface HeaderAuthState {
98
98
  */
99
99
  declare function setHeaderAuth(auth: HeaderAuthState | null): void;
100
100
  /**
101
- * User display data: from IAM only (linn-i-am-userDetails). No dependency on persist:userdb.
101
+ * User display data: prefers linn-i-am-userDetails (IAM), falls back to
102
+ * persist:userdb → profileInformation.userDetails, then authDetails.auth.user.
102
103
  */
103
104
  declare const getUserDataFromStorage: () => {
104
105
  name: string;
@@ -1 +1 @@
1
- .MuiToolbar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important;min-height:var(--size-header-height,65px)!important;padding-left:15px!important}.MuiToolbar-root,.MuiToolbar-root .MuiButtonBase-root{color:var(--color-brand-primary,var(--color-brand-primary))!important}.MuiToolbar-root .MuiButtonBase-root{margin-right:0}.app-header{flex-shrink:0}.app-header,.app-header .MuiAppBar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important}.app-header .MuiAppBar-root{box-shadow:none!important;left:0;position:fixed!important;right:0;top:0;z-index:var(--size-header-zindex,200)!important}.app-header .MuiPaper-root:only-of-type{border-bottom:1px solid var(--color-border-header,var(--color-border-header));box-shadow:none!important;padding:0!important}.var{color:var(--color-brand-accent,var(--color-brand-accent))!important}.miner,.var{font:500 20px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.miner{color:var(--color-brand-deep-navy,var(--color-brand-deep-navy))!important}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-name{color:var(--color-profile-name,var(--color-brand-primary));font:600 16px/28px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-email{color:var(--color-profile-email,var(--color-text-secondary-alpha));font:400 14px/24px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-decoration:underline}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-role{color:var(--color-profile-role,var(--color-text-muted-alpha));font:400 12px/28px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-transform:uppercase}.account-menu:has(.profile-menu-item) .profile-menu-item{padding:10px 15px 5px}.account-menu:has(.profile-menu-item) .MuiMenu-paper{background:var(--color-menu-bg-gradient,linear-gradient(180deg,var(--color-white),var(--color-selected-row),var(--color-selected-row)));box-shadow:none!important;color:var(--color-menu-text,var(--color-black));margin:0;max-width:var(--size-menu-width,280px);width:var(--size-menu-width,280px)}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root{min-width:40px;padding:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root .MuiAvatar-circular{height:40px;margin-left:-10px;margin-right:0;width:40px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root:first-of-type{margin-top:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root .MuiListItemIcon-root .MuiSvgIcon-root{color:var(--color-brand-primary,var(--color-brand-primary))}
1
+ .MuiToolbar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important;min-height:var(--size-header-height,65px)!important;padding-left:15px!important}.MuiToolbar-root,.MuiToolbar-root .MuiButtonBase-root{color:var(--color-brand-primary,var(--color-brand-primary))!important}.MuiToolbar-root .MuiButtonBase-root{margin-right:0}.app-header{flex-shrink:0}.app-header,.app-header .MuiAppBar-root{background-color:var(--color-header-bg,var(--color-white))!important;height:var(--size-header-height,65px)!important}.app-header .MuiAppBar-root{box-shadow:none!important;left:0;position:fixed!important;right:0;top:0;z-index:var(--size-header-zindex,200)!important}.app-header .MuiPaper-root:only-of-type{border-bottom:1px solid var(--color-border-header,var(--color-border-header));box-shadow:none!important;padding:0!important}.var{color:var(--color-brand-accent,var(--color-brand-accent))!important}.miner,.var{font:500 20px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.miner{color:var(--color-brand-deep-navy,var(--color-brand-deep-navy))!important}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-name,[id=account-menu]:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-name{color:var(--color-profile-name,var(--color-brand-primary,var(--color-brand-primary)));font:600 16px/28px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-email,[id=account-menu]:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-email{color:var(--color-profile-email,var(--color-text-secondary-alpha,var(--color-text-secondary-alpha)));font:400 14px/24px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-decoration:underline}.account-menu:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-role,[id=account-menu]:has(.profile-menu-section) .MuiList-root .MuiListItem-root .MuiListItemText-root .MuiTypography-root.profile-role{color:var(--color-profile-role,var(--color-text-muted-alpha,var(--color-text-muted-alpha)));font:400 12px/28px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-transform:uppercase}.profile-name{color:var(--color-profile-name,var(--color-brand-primary,var(--color-brand-primary)));font:600 16px/28px var(--font-brand-semibold,"OpenSans-SemiBold",sans-serif)}.profile-email{color:var(--color-profile-email,var(--color-text-secondary-alpha,var(--color-text-secondary-alpha)));font:400 14px/24px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-decoration:underline}.profile-role{color:var(--color-profile-role,var(--color-text-muted-alpha,var(--color-text-muted-alpha)));font:400 12px/28px var(--font-brand-regular,"OpenSans-Regular",sans-serif);text-transform:uppercase}.account-menu:has(.profile-menu-item) .profile-menu-item,[id=account-menu]:has(.profile-menu-item) .profile-menu-item{padding:10px 15px 5px}.account-menu:has(.profile-menu-item) .MuiMenu-paper,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper{background:var(--color-menu-bg-gradient,linear-gradient(180deg,var(--color-white,var(--color-white)),var(--color-selected-row,var(--color-bg-subtle)),var(--color-selected-row,var(--color-bg-subtle))));box-shadow:none!important;color:var(--color-menu-text,var(--color-black,var(--color-black)));margin:0;max-width:var(--size-menu-width,280px);width:var(--size-menu-width,280px)}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root{min-width:40px;padding:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root .MuiAvatar-circular,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiListItemAvatar-root .MuiAvatar-circular{height:40px;margin-left:-10px;margin-right:0;width:40px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root:first-of-type,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root:first-of-type{margin-top:10px}.account-menu:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root .MuiListItemIcon-root .MuiSvgIcon-root,[id=account-menu]:has(.profile-menu-item) .MuiMenu-paper .MuiMenuItem-root .MuiListItemIcon-root .MuiSvgIcon-root{color:var(--color-brand-primary,var(--color-brand-primary))}
package/dist/index.esm.js CHANGED
@@ -108,21 +108,80 @@ function setHeaderAuth(auth) {
108
108
  }
109
109
  }
110
110
  /**
111
- * User display data: from IAM only (linn-i-am-userDetails). No dependency on persist:userdb.
111
+ * User display data: prefers linn-i-am-userDetails (IAM), falls back to
112
+ * persist:userdb → profileInformation.userDetails, then authDetails.auth.user.
112
113
  */
113
114
  const getUserDataFromStorage = () => {
115
+ // Primary source: IAM app sets this after OTP verification
114
116
  const iamUser = getStoredUserDetails();
115
- if (!iamUser)
116
- return null;
117
- const name = [iamUser.firstName, iamUser.lastName].filter(Boolean).join(" ").trim();
118
- const role = iamUser.roles?.length ? iamUser.roles[0] : iamUser.workInfo?.jobTitle ?? "";
119
- return {
120
- name: name || "",
121
- email: iamUser.email || "",
122
- role: role || "",
123
- avatar: undefined,
124
- initials: name ? name.split(/\s+/).map((s) => s[0]).join("").slice(0, 2).toUpperCase() : undefined,
125
- };
117
+ if (iamUser) {
118
+ const name = [iamUser.firstName, iamUser.lastName].filter(Boolean).join(" ").trim();
119
+ const role = iamUser.roles?.length ? iamUser.roles[0] : iamUser.workInfo?.jobTitle ?? "";
120
+ return {
121
+ name: name || "",
122
+ email: iamUser.email || "",
123
+ role: role || "",
124
+ avatar: undefined,
125
+ initials: name ? name.split(/\s+/).map((s) => s[0]).join("").slice(0, 2).toUpperCase() : undefined,
126
+ };
127
+ }
128
+ // Fallback: read from persist:userdb which is written by the IAM/login app
129
+ try {
130
+ const raw = localStorage.getItem("persist:userdb");
131
+ if (!raw)
132
+ return null;
133
+ const outer = JSON.parse(raw);
134
+ const parseNested = (v) => {
135
+ if (typeof v === "string") {
136
+ try {
137
+ return JSON.parse(v);
138
+ }
139
+ catch {
140
+ return v;
141
+ }
142
+ }
143
+ return v;
144
+ };
145
+ // profileInformation.userDetails has firstName, lastName, email, roles[]
146
+ const profileInfo = parseNested(outer.profileInformation);
147
+ const userDetails = profileInfo?.userDetails;
148
+ if (userDetails && (userDetails.firstName || userDetails.lastName || userDetails.email)) {
149
+ const first = userDetails.firstName || "";
150
+ const last = userDetails.lastName || "";
151
+ const name = [first, last].filter(Boolean).join(" ").trim();
152
+ const roles = userDetails.roles;
153
+ const role = roles?.length ? roles[0] : userDetails.jobTitle ?? "";
154
+ return {
155
+ name,
156
+ email: userDetails.email || "",
157
+ role: role || "",
158
+ avatar: undefined,
159
+ initials: name ? name.split(/\s+/).map((s) => s[0]).join("").slice(0, 2).toUpperCase() : undefined,
160
+ };
161
+ }
162
+ // authDetails.auth.user has firstname/lastname (lowercase n) or firstName/lastName (camelCase) + activeRole
163
+ const authDetailsRaw = parseNested(outer.authDetails);
164
+ const auth = authDetailsRaw?.auth;
165
+ const userObj = auth?.user;
166
+ const firstFromUser = (userObj?.firstname ?? userObj?.firstName ?? userObj?.given_name ?? userObj?.first_name) || "";
167
+ const lastFromUser = (userObj?.lastname ?? userObj?.lastName ?? userObj?.family_name ?? userObj?.last_name) || "";
168
+ const emailFromUser = (userObj?.email ?? userObj?.emailAddress) || (auth?.email ?? auth?.sub) || "";
169
+ if (auth && (firstFromUser || lastFromUser || emailFromUser)) {
170
+ const name = [firstFromUser, lastFromUser].filter(Boolean).join(" ").trim();
171
+ const role = auth.activeRole || auth.role || "";
172
+ return {
173
+ name,
174
+ email: emailFromUser,
175
+ role,
176
+ avatar: undefined,
177
+ initials: name ? name.split(/\s+/).map((s) => s[0]).join("").slice(0, 2).toUpperCase() : undefined,
178
+ };
179
+ }
180
+ }
181
+ catch {
182
+ // ignore parse errors
183
+ }
184
+ return null;
126
185
  };
127
186
  const getNotificationCountFromStorage = () => {
128
187
  const userDbString = localStorage.getItem("persist:userdb");
@@ -277,49 +336,7 @@ const getAllDataFromStorage = () => {
277
336
  console.error("Error parsing header persist:", err);
278
337
  }
279
338
  }
280
- // Fallback: try IAM persist key (persist:linn-i-am) then persist:userdb
281
- const tryParsePersistForAuth = (raw) => {
282
- if (!raw)
283
- return null;
284
- try {
285
- const outer = JSON.parse(raw);
286
- const parseNested = (v) => typeof v === "string" ? (() => { try {
287
- return JSON.parse(v);
288
- }
289
- catch {
290
- return v;
291
- } })() : v;
292
- for (const key of Object.keys(outer)) {
293
- const parsed = parseNested(outer[key]);
294
- if (parsed?.accessToken || parsed?.access_token || parsed?.token || parsed?.refreshToken)
295
- return parsed;
296
- if (parsed?.auth && typeof parsed.auth === "object") {
297
- const a = parsed.auth;
298
- if (a.accessToken || a.access_token || a.token)
299
- return a;
300
- }
301
- }
302
- }
303
- catch {
304
- /* ignore */
305
- }
306
- return null;
307
- };
308
- const iamPersist = localStorage.getItem("persist:linn-i-am");
309
- const iamAuth = tryParsePersistForAuth(iamPersist);
310
- if (iamAuth) {
311
- const token = (iamAuth.accessToken ?? iamAuth.access_token ?? iamAuth.token);
312
- if (token) {
313
- const decodedToken = decodeJWT(token);
314
- return {
315
- ...emptyStorageResult(),
316
- auth: iamAuth,
317
- decodedToken: decodedToken ? Object.fromEntries(Object.entries(decodedToken).map(([k, v]) => [k, v ?? null])) : null,
318
- rawData: iamAuth,
319
- };
320
- }
321
- }
322
- // Fallback: read access token from persist:userdb (e.g. legacy or shared auth)
339
+ // Fallback: read access token from persist:userdb
323
340
  const userDbString = localStorage.getItem("persist:userdb");
324
341
  if (!userDbString) {
325
342
  return emptyStorageResult();
@@ -520,7 +537,6 @@ function getTokenFromUserDbPersist(parsed) {
520
537
  function getAccessTokenForRequest() {
521
538
  const keysToTry = [
522
539
  PERSIST_HEADER_KEY,
523
- "persist:linn-i-am",
524
540
  "persist:userdb",
525
541
  "token",
526
542
  "accessToken",
@@ -786,6 +802,35 @@ const AppHeader = ({ language: languageProp, accessToken: accessTokenProp, objec
786
802
  let userName = "";
787
803
  let userEmail = "";
788
804
  let userRole = "";
805
+ // === DEBUG ===
806
+ const _allLSKeys = [];
807
+ for (let i = 0; i < localStorage.length; i++) {
808
+ const k = localStorage.key(i);
809
+ if (k)
810
+ _allLSKeys.push(k);
811
+ }
812
+ const _dbgRaw = {};
813
+ _allLSKeys.forEach(k => {
814
+ const v = localStorage.getItem(k);
815
+ if (v) {
816
+ try {
817
+ _dbgRaw[k] = JSON.parse(v);
818
+ }
819
+ catch {
820
+ _dbgRaw[k] = v;
821
+ }
822
+ }
823
+ else {
824
+ _dbgRaw[k] = null;
825
+ }
826
+ });
827
+ console.warn("▶▶▶ [AppHeader DEBUG] ALL localStorage keys:", _allLSKeys);
828
+ console.warn("▶▶▶ [AppHeader DEBUG] ALL localStorage values:", _dbgRaw);
829
+ console.warn("▶▶▶ [AppHeader DEBUG] linn-i-am-userDetails:", localStorage.getItem("linn-i-am-userDetails"));
830
+ console.warn("▶▶▶ [AppHeader DEBUG] persist:userdb (raw):", localStorage.getItem("persist:userdb"));
831
+ console.warn("▶▶▶ [AppHeader DEBUG] getAllDataFromStorage():", allData);
832
+ console.warn("▶▶▶ [AppHeader DEBUG] getUserDataFromStorage():", getUserDataFromStorage());
833
+ // === END DEBUG ===
789
834
  const buildNameFromFirstLast = (obj) => {
790
835
  if (!obj || typeof obj !== "object")
791
836
  return "";
@@ -810,8 +855,9 @@ const AppHeader = ({ language: languageProp, accessToken: accessTokenProp, objec
810
855
  }
811
856
  if (allData.auth) {
812
857
  const auth = allData.auth;
813
- userEmail = userEmail || auth.email || auth.sub || "";
814
- userName = userName || auth.name || buildNameFromFirstLast(auth) || "";
858
+ const authUser = auth.user;
859
+ userEmail = userEmail || auth.email || auth.sub || authUser?.email || authUser?.emailAddress || "";
860
+ userName = userName || auth.name || buildNameFromFirstLast(auth) || buildNameFromFirstLast(authUser) || "";
815
861
  userRole = userRole || auth.role || auth.activeRole || "";
816
862
  }
817
863
  if (allData.userDetails) {
@@ -854,13 +900,15 @@ const AppHeader = ({ language: languageProp, accessToken: accessTokenProp, objec
854
900
  const initialsVal = storedUser?.initials ??
855
901
  allData.auth?.initials ??
856
902
  allData.profile?.initials;
857
- return {
903
+ const resolvedUser = {
858
904
  name: userName || "",
859
905
  email: userEmail || "",
860
906
  role: userRole || "",
861
907
  avatar: typeof avatarSrc === "string" ? avatarSrc : undefined,
862
908
  initials: typeof initialsVal === "string" ? initialsVal : undefined,
863
909
  };
910
+ console.warn("▶▶▶ [AppHeader DEBUG] Resolved user state (name/email/role):", resolvedUser);
911
+ return resolvedUser;
864
912
  });
865
913
  const [notificationCount, setNotificationCount] = React__default.useState(() => {
866
914
  const count = getNotificationCountFromStorage();
@@ -928,8 +976,9 @@ const AppHeader = ({ language: languageProp, accessToken: accessTokenProp, objec
928
976
  }
929
977
  if (allData.auth) {
930
978
  const auth = allData.auth;
931
- userEmail = userEmail || auth.email || auth.sub || "";
932
- userName = userName || auth.name || buildNameFromFirstLast(auth) || "";
979
+ const authUser = auth.user;
980
+ userEmail = userEmail || auth.email || auth.sub || authUser?.email || authUser?.emailAddress || "";
981
+ userName = userName || auth.name || buildNameFromFirstLast(auth) || buildNameFromFirstLast(authUser) || "";
933
982
  userRole = userRole || auth.role || auth.activeRole || "";
934
983
  userAvatar = userAvatar || auth.avatar || undefined;
935
984
  userInitials = userInitials || auth.initials || undefined;
@@ -1140,7 +1189,7 @@ const AppHeader = ({ language: languageProp, accessToken: accessTokenProp, objec
1140
1189
  width: "100%",
1141
1190
  maxWidth: 360,
1142
1191
  pointerEvents: "none",
1143
- }, component: "div", "aria-hidden": "true", tabIndex: -1, children: jsxs(ListItem, { alignItems: "flex-start", className: "profile-menu-item", children: [jsx(ListItemAvatar, { children: isOnlineStatus ? (jsx(OnlineBadge, { overlap: "circular", anchorOrigin: { vertical: "bottom", horizontal: "right" }, variant: "dot", title: t.online, "aria-label": `${t.online} status badge`, "data-testid": "online-badge", children: jsx(Avatar, { sx: { bgcolor: deepOrange[500] }, alt: user.name, title: user.name, src: user.avatar, children: getInitials() }) })) : (jsx(OfflineBadge, { overlap: "circular", anchorOrigin: { vertical: "bottom", horizontal: "right" }, variant: "dot", title: t.offline, "aria-label": `${t.offline} status badge`, "data-testid": "offline-badge", children: jsx(Avatar, { sx: { bgcolor: deepOrange[500] }, alt: user.name, title: user.name, src: user.avatar, children: getInitials() }) })) }), jsx(ListItemText, { primary: jsx(Typography, { className: "profile-name", component: "span", children: user.name || user.email }), secondary: jsxs(React__default.Fragment, { children: [user.name && user.email ? (jsx(Typography, { className: "profile-email", component: "p", children: user.email })) : null, jsxs(Typography, { className: "profile-role", component: "p", children: [t.role, ": ", user.role] })] }) })] }) }));
1192
+ }, component: "div", "aria-hidden": "true", tabIndex: -1, children: jsxs(ListItem, { alignItems: "flex-start", className: "profile-menu-item", children: [jsx(ListItemAvatar, { children: isOnlineStatus ? (jsx(OnlineBadge, { overlap: "circular", anchorOrigin: { vertical: "bottom", horizontal: "right" }, variant: "dot", title: t.online, "aria-label": `${t.online} status badge`, "data-testid": "online-badge", children: jsx(Avatar, { sx: { bgcolor: deepOrange[500] }, alt: user.name, title: user.name, src: user.avatar, children: getInitials() }) })) : (jsx(OfflineBadge, { overlap: "circular", anchorOrigin: { vertical: "bottom", horizontal: "right" }, variant: "dot", title: t.offline, "aria-label": `${t.offline} status badge`, "data-testid": "offline-badge", children: jsx(Avatar, { sx: { bgcolor: deepOrange[500] }, alt: user.name, title: user.name, src: user.avatar, children: getInitials() }) })) }), jsx(ListItemText, { primaryTypographyProps: { component: "span" }, secondaryTypographyProps: { component: "span" }, primary: jsx(Typography, { className: "profile-name", component: "span", children: user.name || user.email }), secondary: jsxs(React__default.Fragment, { children: [user.name && user.email ? (jsx(Typography, { className: "profile-email", component: "span", display: "block", children: user.email })) : null, jsxs(Typography, { className: "profile-role", component: "span", display: "block", children: [t.role, ": ", user.role] })] }) })] }) }));
1144
1193
  const renderMenu = (jsxs(Menu, { anchorEl: anchorEl, id: "account-menu", open: open, onClose: handleClose, onClick: handleClose, slotProps: {
1145
1194
  paper: {
1146
1195
  elevation: 0,