@antscorp/antsomi-ui 1.3.7-beta.47 → 1.3.7-beta.49

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.
@@ -315,12 +315,14 @@ export const AccountSharing = props => {
315
315
  };
316
316
  // const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
317
317
  const onClickButtonLogout = useCallback(() => {
318
+ const cdpEnv = PORTAL_CONFIG && PORTAL_CONFIG.ENV;
319
+ const addEnvKey = key => (cdpEnv ? `${key}_${cdpEnv}` : key);
318
320
  // Handle remove cookie and redirect to login
319
321
  removeAppCookieSessionSubdomainPrefix({ name: UOGS_PREFIX, env });
320
322
  removeAppCookieSessionSubdomain({ name: 'c_pid', env });
321
323
  removeAppCookieSessionSubdomain({ name: 'api_token', env });
322
- removeAppCookieSessionSubdomain({ name: 'api_r_token', env });
323
- removeAppCookieSessionSubdomain({ name: 'api_pid', env });
324
+ removeAppCookieSessionSubdomain({ name: addEnvKey('api_r_token'), env });
325
+ removeAppCookieSessionSubdomain({ name: addEnvKey('api_pid'), env });
324
326
  removeAppCookieSessionSubdomain({ name: 'user_id', env });
325
327
  removeAppCookieSessionSubdomain({ name: 'user_logged_in_email', env });
326
328
  removeAppCookieSessionSubdomain({ name: 'user_logged_in_full_name', env });
@@ -208,7 +208,10 @@ export const Login = props => {
208
208
  if (menus && menus.length) {
209
209
  handleLoginData(dataLogin, !isCallbackUrl && !isHomePageUrl, selectedNetworkRef.current && selectedNetworkRef.current.networkId);
210
210
  if (onLoginSuccess && typeof onLoginSuccess === 'function') {
211
- onLoginSuccess(dataLogin);
211
+ onLoginSuccess({
212
+ ...dataLogin,
213
+ networkId: selectedNetworkRef.current?.networkId ?? networkId,
214
+ });
212
215
  setLoadingSkip(false);
213
216
  }
214
217
  else if (isCallbackUrl && callbackUrl) {
@@ -242,7 +245,10 @@ export const Login = props => {
242
245
  handleLoginData(dataLogin, !isCallbackUrl && !isHomePageUrl, selectedNetworkRef.current && selectedNetworkRef.current.networkId);
243
246
  setLoadingSkip(false);
244
247
  if (onLoginSuccess && typeof onLoginSuccess === 'function') {
245
- onLoginSuccess(dataLogin);
248
+ onLoginSuccess({
249
+ ...dataLogin,
250
+ networkId: selectedNetworkRef.current?.networkId ?? networkId,
251
+ });
246
252
  }
247
253
  else if (isCallbackUrl && callbackUrl) {
248
254
  navigateTo(callbackUrl);
@@ -263,7 +269,10 @@ export const Login = props => {
263
269
  setLoadingSkip(false);
264
270
  handleLoginData(dataLogin, !isCallbackUrl && !isHomePageUrl, selectedNetworkRef.current && selectedNetworkRef.current.networkId);
265
271
  if (onLoginSuccess && typeof onLoginSuccess === 'function') {
266
- onLoginSuccess(dataLogin);
272
+ onLoginSuccess({
273
+ ...dataLogin,
274
+ networkId: selectedNetworkRef.current?.networkId ?? networkId,
275
+ });
267
276
  }
268
277
  else if (isCallbackUrl && callbackUrl) {
269
278
  navigateTo(callbackUrl);
@@ -19,6 +19,8 @@ export interface LoginData {
19
19
  G2FA: number;
20
20
  status: boolean;
21
21
  errorCode: string;
22
+ /** The networkId (portalId) of the network the user logged into */
23
+ networkId?: number | string;
22
24
  [key: string]: any;
23
25
  }
24
26
  export interface Account {
@@ -27,8 +27,10 @@ export const removeCookieSubDomain = ({ name, env = 'development', cookieOptions
27
27
  secure: true,
28
28
  ...cookieOptions,
29
29
  });
30
+ const cdpEnv = PORTAL_CONFIG && PORTAL_CONFIG.ENV;
31
+ const addEnvKey = key => (cdpEnv ? `${key}_${cdpEnv}` : key);
30
32
  // Remove redundant cookies setted for full domain
31
- if (['api_token', 'api_r_token', 'api_pid'].includes(name)) {
33
+ if (['api_token', addEnvKey('api_r_token'), addEnvKey('api_pid')].includes(name)) {
32
34
  cookies.remove(name, {
33
35
  path: '/',
34
36
  sameSite: 'none',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.7-beta.47",
3
+ "version": "1.3.7-beta.49",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -164,7 +164,7 @@
164
164
  },
165
165
  "devDependencies": {
166
166
  "@antscorp/antsomi-constants": "1.0.8-beta.1",
167
- "@antscorp/antsomi-locales": "^1.0.86",
167
+ "@antscorp/antsomi-locales": "^1.0.88",
168
168
  "@antscorp/eslint-config-antsomi": "1.0.4",
169
169
  "@babel/cli": "^7.23.4",
170
170
  "@babel/core": "^7.21.3",
@@ -277,36 +277,5 @@
277
277
  "react": ">=16.9.0",
278
278
  "react-dom": ">=16.9.0",
279
279
  "react-router-dom": ">= 5.1.0"
280
- },
281
- "resolutions": {
282
- "@tiptap/core": "3.10.2",
283
- "@tiptap/extension-code": "3.10.2",
284
- "@tiptap/extension-heading": "3.10.2",
285
- "@tiptap/extension-blockquote": "3.10.2",
286
- "@tiptap/extension-bold": "3.10.2",
287
- "@tiptap/extension-bullet-list": "3.10.2",
288
- "@tiptap/extension-code-block": "3.10.2",
289
- "@tiptap/extension-color": "3.10.2",
290
- "@tiptap/extension-document": "3.10.2",
291
- "@tiptap/extension-dropcursor": "3.10.2",
292
- "@tiptap/extension-gapcursor": "3.10.2",
293
- "@tiptap/extension-hard-break": "3.10.2",
294
- "@tiptap/extension-horizontal-rule": "3.10.2",
295
- "@tiptap/extension-image": "3.10.2",
296
- "@tiptap/extension-italic": "3.10.2",
297
- "@tiptap/extension-link": "3.10.2",
298
- "@tiptap/extension-list-item": "3.10.2",
299
- "@tiptap/extension-list-keymap": "3.10.2",
300
- "@tiptap/extension-list": "3.10.2",
301
- "@tiptap/extension-ordered-list": "3.10.2",
302
- "@tiptap/extension-paragraph": "3.10.2",
303
- "@tiptap/extension-strike": "3.10.2",
304
- "@tiptap/extension-text-style": "3.10.2",
305
- "@tiptap/extension-text": "3.10.2",
306
- "@tiptap/extension-bubble-menu": "3.10.2",
307
- "@tiptap/extension-floating-menu": "3.10.2",
308
- "@tiptap/extensions": "3.10.2",
309
- "@tiptap/react": "3.10.2",
310
- "@tiptap/starter-kit": "3.10.2"
311
280
  }
312
281
  }