@logickernel/bridge 0.11.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.
package/dist/next/components.cjs
CHANGED
|
@@ -13,6 +13,7 @@ var navigation = require('next/navigation');
|
|
|
13
13
|
var Link = require('next/link');
|
|
14
14
|
var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
|
|
15
15
|
var react = require('next-auth/react');
|
|
16
|
+
require('jose');
|
|
16
17
|
var AvatarPrimitive = require('@radix-ui/react-avatar');
|
|
17
18
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
18
19
|
|
|
@@ -900,6 +901,16 @@ function NavMain({ items }) {
|
|
|
900
901
|
] }, groupIndex);
|
|
901
902
|
}) });
|
|
902
903
|
}
|
|
904
|
+
function getAuthUrl() {
|
|
905
|
+
return process.env.AUTH_URL || process.env.BASE_URL || "http://localhost:3000";
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
// src/routes.ts
|
|
909
|
+
function buildSignInUrl(callbackUrl) {
|
|
910
|
+
const authUrl = getAuthUrl();
|
|
911
|
+
const url = new URL("/core/auth/signin", authUrl);
|
|
912
|
+
return url;
|
|
913
|
+
}
|
|
903
914
|
function Avatar({
|
|
904
915
|
className,
|
|
905
916
|
...props
|
|
@@ -1059,13 +1070,12 @@ function getInitials(name, email) {
|
|
|
1059
1070
|
function NavUser({ user }) {
|
|
1060
1071
|
const sidebar = useSidebar();
|
|
1061
1072
|
const isMobile = sidebar?.isMobile ?? false;
|
|
1062
|
-
const router = navigation.useRouter();
|
|
1063
1073
|
const initials = getInitials(user.name, user.email);
|
|
1064
1074
|
const displayName = user.name || user.email;
|
|
1065
1075
|
const handleSignOut = async () => {
|
|
1066
1076
|
await react.signOut({ redirect: false });
|
|
1067
|
-
|
|
1068
|
-
|
|
1077
|
+
const signInUrl = buildSignInUrl();
|
|
1078
|
+
window.location.href = signInUrl.toString();
|
|
1069
1079
|
};
|
|
1070
1080
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarMenu, { children: /* @__PURE__ */ jsxRuntime.jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { children: [
|
|
1071
1081
|
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|