@logickernel/bridge 0.10.0 → 0.11.1

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.
@@ -13,6 +13,7 @@ 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';
16
17
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
17
18
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
18
19
 
@@ -871,6 +872,16 @@ function NavMain({ items }) {
871
872
  ] }, groupIndex);
872
873
  }) });
873
874
  }
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
+ }
874
885
  function Avatar({
875
886
  className,
876
887
  ...props
@@ -1030,13 +1041,12 @@ function getInitials(name, email) {
1030
1041
  function NavUser({ user }) {
1031
1042
  const sidebar = useSidebar();
1032
1043
  const isMobile = sidebar?.isMobile ?? false;
1033
- const router = useRouter();
1034
1044
  const initials = getInitials(user.name, user.email);
1035
1045
  const displayName = user.name || user.email;
1036
1046
  const handleSignOut = async () => {
1037
1047
  await signOut({ redirect: false });
1038
- router.push("/core/auth/signin");
1039
- router.refresh();
1048
+ const signInUrl = buildSignInUrl();
1049
+ window.location.href = signInUrl.toString();
1040
1050
  };
1041
1051
  return /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
1042
1052
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(