@antscorp/antsomi-ui 1.3.7-beta.50 → 1.3.7-beta.52

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,8 +315,7 @@ 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
+ const addEnvKey = key => (env ? `${key}_${env}` : key);
320
319
  // Handle remove cookie and redirect to login
321
320
  removeAppCookieSessionSubdomainPrefix({ name: UOGS_PREFIX, env });
322
321
  removeAppCookieSessionSubdomain({ name: 'c_pid', env });
@@ -429,7 +428,12 @@ export const AccountSharing = props => {
429
428
  }
430
429
  }
431
430
  }
432
- if (selectedNetworkRef.current && selectedNetworkRef.current.homePage) {
431
+ if (portalRedirectUrl) {
432
+ window.location.href = portalRedirectUrl
433
+ .replace(/:portal_id/g, selectedNetworkRef.current.networkId)
434
+ .replace(/:user_id/g, String(accountId || ''));
435
+ }
436
+ else if (selectedNetworkRef.current && selectedNetworkRef.current.homePage) {
433
437
  getAppsMenus({
434
438
  token: postParam.token,
435
439
  userId: accountId,
@@ -495,14 +499,7 @@ export const AccountSharing = props => {
495
499
  if (+networkId === +network.networkId) {
496
500
  return;
497
501
  }
498
- if (portalRedirectUrl) {
499
- window.location.href = portalRedirectUrl
500
- .replace(/:portal_id/g, network.networkId)
501
- .replace(/:user_id/g, String(accountId || ''));
502
- }
503
- else {
504
- loginNetworkWithToken(network);
505
- }
502
+ loginNetworkWithToken(network);
506
503
  };
507
504
  const handleSwitchAccount = async (account) => {
508
505
  await logAccountSwitch(account.user_id);
@@ -27,8 +27,7 @@ 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
+ const addEnvKey = key => (env ? `${key}_${env}` : key);
32
31
  // Remove redundant cookies setted for full domain
33
32
  if (['api_token', addEnvKey('api_r_token'), addEnvKey('api_pid')].includes(name)) {
34
33
  cookies.remove(name, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.7-beta.50",
3
+ "version": "1.3.7-beta.52",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",