@shellui/core 0.3.0-beta.1 → 0.3.0-beta.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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.2",
|
|
4
4
|
"description": "ShellUI Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"workbox-routing": "^7.4.0",
|
|
63
63
|
"workbox-strategies": "^7.4.0",
|
|
64
64
|
"workbox-window": "^7.4.0",
|
|
65
|
-
"@shellui/sdk": "0.3.0-beta.
|
|
65
|
+
"@shellui/sdk": "0.3.0-beta.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
const DEVICE_ID_STORAGE_KEY = 'shellui_auth_client_device_id';
|
|
7
|
-
const COMPANY_ID_STORAGE_KEY = 'shellui_auth_company_id';
|
|
8
7
|
|
|
9
8
|
const IANA_TZ_RE = /^[A-Za-z0-9_+/\-]{1,64}$/;
|
|
10
9
|
|
|
@@ -65,25 +64,9 @@ export function getShellUILoginDeviceId(): string {
|
|
|
65
64
|
|
|
66
65
|
/**
|
|
67
66
|
* Preferred company id for tenant-scoped auth calls.
|
|
68
|
-
* Uses
|
|
67
|
+
* Uses the configured value from shellui auth config (no persistence; config changes apply immediately).
|
|
69
68
|
*/
|
|
70
69
|
export function getShellUILoginCompanyId(fallbackCompanyId?: string | number): string {
|
|
71
70
|
const fallback = `${fallbackCompanyId ?? ''}`.trim();
|
|
72
|
-
|
|
73
|
-
if (typeof window === 'undefined') {
|
|
74
|
-
return validFallback;
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
const stored = localStorage.getItem(COMPANY_ID_STORAGE_KEY)?.trim() ?? '';
|
|
78
|
-
if (stored && /^\d+$/.test(stored)) {
|
|
79
|
-
return stored;
|
|
80
|
-
}
|
|
81
|
-
if (validFallback) {
|
|
82
|
-
localStorage.setItem(COMPANY_ID_STORAGE_KEY, validFallback);
|
|
83
|
-
return validFallback;
|
|
84
|
-
}
|
|
85
|
-
} catch {
|
|
86
|
-
return validFallback;
|
|
87
|
-
}
|
|
88
|
-
return '';
|
|
71
|
+
return fallback && /^\d+$/.test(fallback) ? fallback : '';
|
|
89
72
|
}
|