@logickernel/bridge 0.15.5 → 0.15.7

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.
@@ -1275,16 +1275,17 @@ function AppSidebar({
1275
1275
  }) {
1276
1276
  const currentPathname = navigation.usePathname();
1277
1277
  const pathSegments = currentPathname.split("/").filter(Boolean);
1278
+ const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1278
1279
  let pathOrgId = null;
1279
- if (pathSegments.length >= 2) {
1280
- const potentialOrgId = pathSegments[1];
1281
- if (potentialOrgId && (potentialOrgId.includes("-") || potentialOrgId.length >= 8)) {
1282
- pathOrgId = potentialOrgId;
1283
- }
1284
- } else if (pathSegments.length === 1) {
1285
- const potentialOrgId = pathSegments[0];
1286
- if (potentialOrgId && (potentialOrgId.includes("-") || potentialOrgId.length >= 8)) {
1287
- pathOrgId = potentialOrgId;
1280
+ if (pathSegments.length >= 1) {
1281
+ const firstSegment = pathSegments[0];
1282
+ if (firstSegment && uuidRegex.test(firstSegment)) {
1283
+ pathOrgId = firstSegment;
1284
+ } else if (pathSegments.length >= 2) {
1285
+ const secondSegment = pathSegments[1];
1286
+ if (secondSegment && uuidRegex.test(secondSegment)) {
1287
+ pathOrgId = secondSegment;
1288
+ }
1288
1289
  }
1289
1290
  }
1290
1291
  const detectedOrgId = organizationId || pathOrgId || void 0;