@okjt/dashboard 0.2.1 → 0.2.2

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.
@@ -104,9 +104,9 @@ function AuthProvider({ api, extend, children }) {
104
104
  return { success: false, message: error.response?.data?.message || "Could not resend \u2014 try again." };
105
105
  }
106
106
  };
107
- const verifyEmail = async ({ id, hash }) => {
107
+ const verifyEmail = async ({ id, hash, expires, signature }) => {
108
108
  try {
109
- const response = await api.post("/email/verify", { id, hash });
109
+ const response = await api.post("/email/verify", { id, hash, expires, signature });
110
110
  const { token, user: user2, message: _message, email_verified: _verified, ...extra } = response.data;
111
111
  if (token) {
112
112
  localStorage.setItem("auth_token", token);
@@ -1,10 +1,13 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
- import { useNavigate, useParams } from "react-router-dom";
3
+ import { useNavigate, useParams, useSearchParams } from "react-router-dom";
4
4
  import { useAuth } from "./AuthContext.js";
5
5
  import AuthLayout, { AuthError } from "./AuthLayout.js";
6
6
  function VerifyEmailPage({ layout: Layout = AuthLayout, next = "/", signInPath = "/sign-in" }) {
7
7
  const { id, hash } = useParams();
8
+ const [params] = useSearchParams();
9
+ const expires = params.get("expires");
10
+ const signature = params.get("signature");
8
11
  const navigate = useNavigate();
9
12
  const { verifyEmail } = useAuth();
10
13
  const [error, setError] = useState(null);
@@ -12,7 +15,7 @@ function VerifyEmailPage({ layout: Layout = AuthLayout, next = "/", signInPath =
12
15
  useEffect(() => {
13
16
  let cancelled = false;
14
17
  (async () => {
15
- const result = await verifyEmail({ id, hash });
18
+ const result = await verifyEmail({ id, hash, expires, signature });
16
19
  if (cancelled) return;
17
20
  if (result.success) {
18
21
  setDone(true);
@@ -24,7 +27,7 @@ function VerifyEmailPage({ layout: Layout = AuthLayout, next = "/", signInPath =
24
27
  return () => {
25
28
  cancelled = true;
26
29
  };
27
- }, [id, hash]);
30
+ }, [id, hash, expires, signature]);
28
31
  return /* @__PURE__ */ jsxs(
29
32
  Layout,
30
33
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okjt/dashboard",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Dashboard pages for OKJTech projects: page layout, hero, summary cards, floating toolbar with search and filters, side panel, lists, bulk actions, one way to save, and working together: presence, version history, sharing; the dashboard shell, sign-in pages and account menu",
5
5
  "type": "module",
6
6
  "license": "MIT",