@logickernel/bridge 0.11.1 → 0.11.3
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/dist/next/components.js
CHANGED
|
@@ -13,7 +13,6 @@ import { usePathname, useRouter } from 'next/navigation';
|
|
|
13
13
|
import Link from 'next/link';
|
|
14
14
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
15
15
|
import { signOut } from 'next-auth/react';
|
|
16
|
-
import 'jose';
|
|
17
16
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
18
17
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
19
18
|
|
|
@@ -872,16 +871,6 @@ function NavMain({ items }) {
|
|
|
872
871
|
] }, groupIndex);
|
|
873
872
|
}) });
|
|
874
873
|
}
|
|
875
|
-
function getAuthUrl() {
|
|
876
|
-
return process.env.AUTH_URL || process.env.BASE_URL || "http://localhost:3000";
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
// src/routes.ts
|
|
880
|
-
function buildSignInUrl(callbackUrl) {
|
|
881
|
-
const authUrl = getAuthUrl();
|
|
882
|
-
const url = new URL("/core/auth/signin", authUrl);
|
|
883
|
-
return url;
|
|
884
|
-
}
|
|
885
874
|
function Avatar({
|
|
886
875
|
className,
|
|
887
876
|
...props
|
|
@@ -1045,8 +1034,7 @@ function NavUser({ user }) {
|
|
|
1045
1034
|
const displayName = user.name || user.email;
|
|
1046
1035
|
const handleSignOut = async () => {
|
|
1047
1036
|
await signOut({ redirect: false });
|
|
1048
|
-
|
|
1049
|
-
window.location.href = signInUrl.toString();
|
|
1037
|
+
window.location.href = "/core/auth/signin";
|
|
1050
1038
|
};
|
|
1051
1039
|
return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1052
1040
|
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
@@ -1108,22 +1096,23 @@ function TeamSwitcher({
|
|
|
1108
1096
|
const isMobile = sidebar?.isMobile ?? false;
|
|
1109
1097
|
const pathname = usePathname();
|
|
1110
1098
|
const router = useRouter();
|
|
1111
|
-
const pathSegments = pathname.split("/");
|
|
1112
|
-
const
|
|
1113
|
-
const
|
|
1099
|
+
const pathSegments = pathname.split("/").filter(Boolean);
|
|
1100
|
+
const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
|
|
1101
|
+
const potentialOrgId = pathSegments.length >= 1 ? pathSegments[0] : null;
|
|
1102
|
+
const pathOrgId = potentialOrgId && !skipSegments.includes(potentialOrgId) && (potentialOrgId.includes("-") || potentialOrgId.length >= 8) ? potentialOrgId : null;
|
|
1114
1103
|
const currentOrgId = organizationId || (pathOrgId && teams.some((team) => team.id === pathOrgId) ? pathOrgId : null);
|
|
1115
1104
|
const handleTeamChange = (teamId) => {
|
|
1116
1105
|
if (isMobile && sidebar?.setOpenMobile) {
|
|
1117
1106
|
sidebar.setOpenMobile(false);
|
|
1118
1107
|
}
|
|
1119
|
-
router.push(
|
|
1108
|
+
router.push(`/${teamId}/home`);
|
|
1120
1109
|
router.refresh();
|
|
1121
1110
|
};
|
|
1122
1111
|
const handleManageOrganizations = () => {
|
|
1123
1112
|
if (isMobile && sidebar?.setOpenMobile) {
|
|
1124
1113
|
sidebar.setOpenMobile(false);
|
|
1125
1114
|
}
|
|
1126
|
-
router.push("/
|
|
1115
|
+
router.push("/user/organizations");
|
|
1127
1116
|
};
|
|
1128
1117
|
const teamsWithLogo = teams.map((org) => {
|
|
1129
1118
|
const logoIcon = org.logo ? getIconComponent(org.logo) : GalleryVerticalEnd;
|
|
@@ -1301,12 +1290,7 @@ function AppSidebar({
|
|
|
1301
1290
|
const currentPathname = usePathname();
|
|
1302
1291
|
const pathSegments = currentPathname.split("/").filter(Boolean);
|
|
1303
1292
|
let pathOrgId = null;
|
|
1304
|
-
if (pathSegments.length >=
|
|
1305
|
-
const potentialOrgId = pathSegments[1];
|
|
1306
|
-
if (potentialOrgId && potentialOrgId !== "user") {
|
|
1307
|
-
pathOrgId = potentialOrgId;
|
|
1308
|
-
}
|
|
1309
|
-
} else if (pathSegments.length >= 1) {
|
|
1293
|
+
if (pathSegments.length >= 1) {
|
|
1310
1294
|
const potentialOrgId = pathSegments[0];
|
|
1311
1295
|
const skipSegments = ["user", "api", "auth", "dashboard", "settings", "app"];
|
|
1312
1296
|
if (potentialOrgId && !skipSegments.includes(potentialOrgId)) {
|