@stackframe/stack-shared 2.6.21 → 2.6.23

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @stackframe/stack-shared
2
2
 
3
+ ## 2.6.23
4
+
5
+ ### Patch Changes
6
+
7
+ - Bugfixes
8
+ - Updated dependencies
9
+ - @stackframe/stack-sc@2.6.23
10
+
11
+ ## 2.6.22
12
+
13
+ ### Patch Changes
14
+
15
+ - Bugfixes
16
+ - Updated dependencies
17
+ - @stackframe/stack-sc@2.6.22
18
+
3
19
  ## 2.6.21
4
20
 
5
21
  ### Patch Changes
@@ -1 +1 @@
1
- export declare const useHash: () => string | undefined;
1
+ export declare const useHash: () => string;
@@ -1,9 +1,9 @@
1
- import { useParams } from "next/navigation";
2
- import { useEffect, useState } from "react";
3
- const getHash = () => typeof window === "undefined" ? undefined : window.location.hash.substring(1);
1
+ import { useSyncExternalStore } from "react";
2
+ import { suspendIfSsr } from "../utils/react";
4
3
  export const useHash = () => {
5
- const params = useParams();
6
- const [hash, setHash] = useState(getHash());
7
- useEffect(() => setHash(getHash()), [params]);
8
- return hash;
4
+ suspendIfSsr("useHash");
5
+ return useSyncExternalStore((onChange) => {
6
+ const interval = setInterval(() => onChange(), 10);
7
+ return () => clearInterval(interval);
8
+ }, () => window.location.hash.substring(1));
9
9
  };
@@ -338,7 +338,7 @@ const EmailPasswordMismatch = createKnownErrorConstructor(KnownError, "EMAIL_PAS
338
338
  ], () => []);
339
339
  const RedirectUrlNotWhitelisted = createKnownErrorConstructor(KnownError, "REDIRECT_URL_NOT_WHITELISTED", () => [
340
340
  400,
341
- "Redirect URL not whitelisted.",
341
+ "Redirect URL not whitelisted. Did you forget to add this domain to the trusted domains list on the Stack Auth dashboard?",
342
342
  ], () => []);
343
343
  const PasswordRequirementsNotMet = createKnownErrorConstructor(KnownError, "PASSWORD_REQUIREMENTS_NOT_MET", "inherit", "inherit");
344
344
  const PasswordTooShort = createKnownErrorConstructor(PasswordRequirementsNotMet, "PASSWORD_TOO_SHORT", (minLength) => [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-shared",
3
- "version": "2.6.21",
3
+ "version": "2.6.23",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -20,11 +20,11 @@
20
20
  }
21
21
  },
22
22
  "peerDependencies": {
23
- "react": ">=18.2",
24
- "react-dom": ">=18.2",
25
- "@types/react": ">=18.2",
26
- "@types/react-dom": ">=18.2",
27
- "next": ">=14.1.0",
23
+ "react": ">=18.2 || >=19.0.0-rc.0",
24
+ "react-dom": ">=18.2 || >=19.0.0-rc.0",
25
+ "@types/react": ">=18.2 || >=19.0.0-rc.0",
26
+ "@types/react-dom": ">=18.2 || >=19.0.0-rc.0",
27
+ "next": ">=14.1.0 || >=15.0.0-rc.0",
28
28
  "yup": "^1.4.0"
29
29
  },
30
30
  "peerDependenciesMeta": {
@@ -49,7 +49,7 @@
49
49
  "oauth4webapi": "^2.10.3",
50
50
  "semver": "^7.6.3",
51
51
  "uuid": "^9.0.1",
52
- "@stackframe/stack-sc": "2.6.21"
52
+ "@stackframe/stack-sc": "2.6.23"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@simplewebauthn/types": "^11.0.0",