@hachej/boring-core 0.1.49 → 0.1.50

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.
@@ -9,7 +9,7 @@ import {
9
9
  useSignIn,
10
10
  useSignUp,
11
11
  useWorkspaceRouteStatus
12
- } from "../../chunk-P4RF2D7H.js";
12
+ } from "../../chunk-2ZTKRLVG.js";
13
13
  import "../../chunk-HYNKZSTF.js";
14
14
  import {
15
15
  isRuntimeEmailVerificationEnabled
@@ -1232,16 +1232,23 @@ function getCookie(name) {
1232
1232
  function deleteCookie(name) {
1233
1233
  document.cookie = `${name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
1234
1234
  }
1235
+ function navigateToSignIn() {
1236
+ if (typeof window === "undefined") return;
1237
+ window.history.replaceState({}, "", routes.signin);
1238
+ window.dispatchEvent(new PopStateEvent("popstate"));
1239
+ }
1235
1240
  function VerifyEmailPage() {
1236
1241
  const session = useSession();
1237
1242
  const verifyEmail = useVerifyEmail();
1238
1243
  const sendVerificationEmail = useSendVerificationEmail();
1244
+ const signOut = useSignOut();
1239
1245
  const token = typeof window !== "undefined" ? new URLSearchParams(window.location.search).get("token") : null;
1240
1246
  const [status, setStatus] = useState12(token ? "verifying" : "no-token");
1241
1247
  const [inviteWarning, setInviteWarning] = useState12(null);
1242
1248
  const [cooldown, setCooldown] = useState12(0);
1243
1249
  const [resendEmail, setResendEmail] = useState12("");
1244
1250
  const [resendSent, setResendSent] = useState12(false);
1251
+ const [isSigningOut, setIsSigningOut] = useState12(false);
1245
1252
  const verifiedRef = useRef4(false);
1246
1253
  const sessionEmail = session.data?.user?.email ?? null;
1247
1254
  useEffect8(() => {
@@ -1296,6 +1303,15 @@ function VerifyEmailPage() {
1296
1303
  setResendSent(true);
1297
1304
  setCooldown(60);
1298
1305
  }, [sessionEmail, resendEmail, cooldown, sendVerificationEmail]);
1306
+ const handleBackToSignIn = useCallback3(async () => {
1307
+ if (isSigningOut) return;
1308
+ setIsSigningOut(true);
1309
+ try {
1310
+ await signOut();
1311
+ } finally {
1312
+ navigateToSignIn();
1313
+ }
1314
+ }, [isSigningOut, signOut]);
1299
1315
  const resendButton = /* @__PURE__ */ jsx12(
1300
1316
  Button7,
1301
1317
  {
@@ -1347,7 +1363,17 @@ function VerifyEmailPage() {
1347
1363
  /* @__PURE__ */ jsx12(CardDescription5, { children: "This verification link is no longer valid. Request a new one below." })
1348
1364
  ] }),
1349
1365
  /* @__PURE__ */ jsx12(CardContent5, { children: resendSection }),
1350
- /* @__PURE__ */ jsx12(CardFooter5, { children: /* @__PURE__ */ jsx12("a", { href: routes.signin, className: "text-sm text-muted-foreground hover:underline", children: "Back to sign in" }) })
1366
+ /* @__PURE__ */ jsx12(CardFooter5, { children: /* @__PURE__ */ jsx12(
1367
+ Button7,
1368
+ {
1369
+ type: "button",
1370
+ variant: "link",
1371
+ className: "h-auto p-0 text-sm text-muted-foreground hover:underline",
1372
+ disabled: isSigningOut,
1373
+ onClick: handleBackToSignIn,
1374
+ children: isSigningOut ? "Signing out\u2026" : "Back to sign in"
1375
+ }
1376
+ ) })
1351
1377
  ] }) });
1352
1378
  }
1353
1379
  const isWaitingForEmailClick = status === "no-token" && Boolean(sessionEmail);
@@ -1358,7 +1384,17 @@ function VerifyEmailPage() {
1358
1384
  /* @__PURE__ */ jsx12(CardDescription5, { children: isWaitingForEmailClick ? "We sent a verification link to your email address. Please check your inbox to continue." : status === "no-token" ? "No verification token found. Check the link in your email." : "This verification link is invalid. Request a new one below." })
1359
1385
  ] }),
1360
1386
  /* @__PURE__ */ jsx12(CardContent5, { children: resendSection }),
1361
- /* @__PURE__ */ jsx12(CardFooter5, { children: /* @__PURE__ */ jsx12("a", { href: routes.signin, className: "text-sm text-muted-foreground hover:underline", children: "Back to sign in" }) })
1387
+ /* @__PURE__ */ jsx12(CardFooter5, { children: /* @__PURE__ */ jsx12(
1388
+ Button7,
1389
+ {
1390
+ type: "button",
1391
+ variant: "link",
1392
+ className: "h-auto p-0 text-sm text-muted-foreground hover:underline",
1393
+ disabled: isSigningOut,
1394
+ onClick: handleBackToSignIn,
1395
+ children: isSigningOut ? "Signing out\u2026" : "Back to sign in"
1396
+ }
1397
+ ) })
1362
1398
  ] }) });
1363
1399
  }
1364
1400
 
@@ -58,7 +58,7 @@ import {
58
58
  useWorkspaceMembers,
59
59
  useWorkspaceRole,
60
60
  useWorkspaceRouteStatus
61
- } from "../chunk-P4RF2D7H.js";
61
+ } from "../chunk-2ZTKRLVG.js";
62
62
  import {
63
63
  TopBarSlotProvider,
64
64
  useTopBarSlot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-core",
3
- "version": "0.1.49",
3
+ "version": "0.1.50",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Foundation package for boring-ui-v2 apps: DB, auth, config, HTTP app factory, and frontend app shell.",
@@ -79,9 +79,9 @@
79
79
  "react-router-dom": "^7.14.2",
80
80
  "smol-toml": "^1.6.1",
81
81
  "zod": "^3.25.76",
82
- "@hachej/boring-workspace": "0.1.49",
83
- "@hachej/boring-ui-kit": "0.1.49",
84
- "@hachej/boring-agent": "0.1.49"
82
+ "@hachej/boring-agent": "0.1.50",
83
+ "@hachej/boring-ui-kit": "0.1.50",
84
+ "@hachej/boring-workspace": "0.1.50"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@testing-library/jest-dom": "^6.9.1",