@clerk/react 6.9.0 → 6.9.1-canary.v20260610190754
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/ClerkProvider-9lxHp9j5.cjs +1623 -0
- package/dist/ClerkProvider-9lxHp9j5.cjs.map +1 -0
- package/dist/ClerkProvider-LQpPtmNL.mjs +1533 -0
- package/dist/ClerkProvider-LQpPtmNL.mjs.map +1 -0
- package/dist/errors.cjs +69 -0
- package/dist/errors.d.cts +2 -0
- package/dist/errors.d.mts +2 -1
- package/dist/errors.mjs +2 -29
- package/dist/experimental.cjs +270 -0
- package/dist/experimental.cjs.map +1 -0
- package/dist/{experimental.d.ts → experimental.d.cts} +18 -18
- package/dist/experimental.d.mts +18 -18
- package/dist/experimental.mjs +201 -165
- package/dist/experimental.mjs.map +1 -1
- package/dist/hooks-BiY5Zgpp.mjs +1369 -0
- package/dist/hooks-BiY5Zgpp.mjs.map +1 -0
- package/dist/hooks-CBghYU21.cjs +1606 -0
- package/dist/hooks-CBghYU21.cjs.map +1 -0
- package/dist/index.cjs +447 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +345 -0
- package/dist/index.d.mts +183 -157
- package/dist/index.mjs +285 -380
- package/dist/index.mjs.map +1 -1
- package/dist/internal.cjs +107 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.cts +51 -0
- package/dist/internal.d.mts +24 -26
- package/dist/internal.mjs +39 -73
- package/dist/internal.mjs.map +1 -1
- package/dist/legacy.cjs +134 -0
- package/dist/legacy.cjs.map +1 -0
- package/dist/{legacy.d.ts → legacy.d.cts} +6 -3
- package/dist/legacy.d.mts +6 -3
- package/dist/legacy.mjs +126 -42
- package/dist/legacy.mjs.map +1 -1
- package/dist/types-Bwenmt7y.d.cts +10951 -0
- package/dist/types-CiIhevkA.d.mts +10951 -0
- package/dist/types.cjs +0 -0
- package/dist/types.d.cts +3 -0
- package/dist/types.d.mts +3 -109
- package/dist/types.mjs +1 -2
- package/dist/useAssertWrappedByClerkProvider-Cm0djUcB.cjs +52 -0
- package/dist/useAssertWrappedByClerkProvider-Cm0djUcB.cjs.map +1 -0
- package/dist/useAssertWrappedByClerkProvider-GaNwZpWo.mjs +29 -0
- package/dist/useAssertWrappedByClerkProvider-GaNwZpWo.mjs.map +1 -0
- package/dist/{useAuth-Dlg_G1_7.d.mts → useAuth-BK5Y4htK.d.mts} +58 -39
- package/dist/{useAuth-Cv6iRjL9.d.ts → useAuth-BMxaWktj.d.cts} +58 -39
- package/package.json +18 -18
- package/dist/chunk-E5QRIS4Z.mjs +0 -20
- package/dist/chunk-E5QRIS4Z.mjs.map +0 -1
- package/dist/chunk-FQVXBXXF.mjs +0 -1487
- package/dist/chunk-FQVXBXXF.mjs.map +0 -1
- package/dist/chunk-GVGS7DUS.mjs +0 -2097
- package/dist/chunk-GVGS7DUS.mjs.map +0 -1
- package/dist/chunk-RQWALB2R.mjs +0 -26
- package/dist/chunk-RQWALB2R.mjs.map +0 -1
- package/dist/errors.d.ts +0 -1
- package/dist/errors.js +0 -51
- package/dist/errors.js.map +0 -1
- package/dist/errors.mjs.map +0 -1
- package/dist/experimental.js +0 -1505
- package/dist/experimental.js.map +0 -1
- package/dist/index.d.ts +0 -319
- package/dist/index.js +0 -3919
- package/dist/index.js.map +0 -1
- package/dist/internal.d.ts +0 -53
- package/dist/internal.js +0 -3339
- package/dist/internal.js.map +0 -1
- package/dist/legacy.js +0 -90
- package/dist/legacy.js.map +0 -1
- package/dist/types.d.ts +0 -109
- package/dist/types.js +0 -19
- package/dist/types.js.map +0 -1
- package/dist/types.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacy.cjs","names":["useIsomorphicClerkContext","useIsomorphicClerkContext"],"sources":["../src/hooks/legacy/useSignIn.ts","../src/hooks/legacy/useSignUp.ts"],"sourcesContent":["import { __internal_useClientBase } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignInReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-in\n *\n * The following example uses the `useSignIn()` hook to access the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignInPage.tsx' }}\n * import { useSignIn } from '@clerk/react'\n *\n * export default function SignInPage() {\n * const { isLoaded, signIn } = useSignIn()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-in attempt status is {signIn?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../../docs/legacy-use-sign-in.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-in flow with `useSignIn()`\n *\n * The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignIn = (): UseSignInReturn => {\n useAssertWrappedByClerkProvider('useSignIn');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = __internal_useClientBase();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignIn'));\n\n if (!client) {\n return { isLoaded: false, signIn: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signIn: client.signIn,\n setActive: isomorphicClerk.setActive,\n };\n};\n","import { __internal_useClientBase } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignUpReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-up\n *\n * The following example uses the `useSignUp()` hook to access the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignUpPage.tsx' }}\n * import { useSignUp } from '@clerk/react'\n *\n * export default function SignUpPage() {\n * const { isLoaded, signUp } = useSignUp()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-up attempt status is {signUp?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../../docs/legacy-use-sign-up.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-up flow with `useSignUp()`\n *\n * The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignUp = (): UseSignUpReturn => {\n useAssertWrappedByClerkProvider('useSignUp');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = __internal_useClientBase();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignUp'));\n\n if (!client) {\n return { isLoaded: false, signUp: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signUp: client.signUp,\n setActive: isomorphicClerk.setActive,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,kBAAmC;CAC9C,wEAAgC,WAAW;CAE3C,MAAM,kBAAkBA,kEAA0B;CAClD,MAAM,2DAAkC;CAExC,gBAAgB,WAAW,sDAAyB,WAAW,CAAC;CAEhE,IAAI,CAAC,QACH,OAAO;EAAE,UAAU;EAAO,QAAQ;EAAW,WAAW;CAAU;CAGpE,OAAO;EACL,UAAU;EACV,QAAQ,OAAO;EACf,WAAW,gBAAgB;CAC7B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjBA,MAAa,kBAAmC;CAC9C,wEAAgC,WAAW;CAE3C,MAAM,kBAAkBC,kEAA0B;CAClD,MAAM,2DAAkC;CAExC,gBAAgB,WAAW,sDAAyB,WAAW,CAAC;CAEhE,IAAI,CAAC,QACH,OAAO;EAAE,UAAU;EAAO,QAAQ;EAAW,WAAW;CAAU;CAGpE,OAAO;EACL,UAAU;EACV,QAAQ,OAAO;EACf,WAAW,gBAAgB;CAC7B;AACF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { UseSignInReturn, UseSignUpReturn } from
|
|
1
|
+
import { UseSignInReturn, UseSignUpReturn } from "@clerk/shared/types";
|
|
2
2
|
|
|
3
|
+
//#region src/hooks/legacy/useSignIn.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
5
6
|
*
|
|
@@ -45,7 +46,8 @@ import { UseSignInReturn, UseSignUpReturn } from '@clerk/shared/types';
|
|
|
45
46
|
* ```empty```
|
|
46
47
|
*/
|
|
47
48
|
declare const useSignIn: () => UseSignInReturn;
|
|
48
|
-
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/hooks/legacy/useSignUp.d.ts
|
|
49
51
|
/**
|
|
50
52
|
* The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
51
53
|
*
|
|
@@ -91,5 +93,6 @@ declare const useSignIn: () => UseSignInReturn;
|
|
|
91
93
|
* ```empty```
|
|
92
94
|
*/
|
|
93
95
|
declare const useSignUp: () => UseSignUpReturn;
|
|
94
|
-
|
|
96
|
+
//#endregion
|
|
95
97
|
export { useSignIn, useSignUp };
|
|
98
|
+
//# sourceMappingURL=legacy.d.cts.map
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { UseSignInReturn, UseSignUpReturn } from
|
|
1
|
+
import { UseSignInReturn, UseSignUpReturn } from "@clerk/shared/types";
|
|
2
2
|
|
|
3
|
+
//#region src/hooks/legacy/useSignIn.d.ts
|
|
3
4
|
/**
|
|
4
5
|
* The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
5
6
|
*
|
|
@@ -45,7 +46,8 @@ import { UseSignInReturn, UseSignUpReturn } from '@clerk/shared/types';
|
|
|
45
46
|
* ```empty```
|
|
46
47
|
*/
|
|
47
48
|
declare const useSignIn: () => UseSignInReturn;
|
|
48
|
-
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/hooks/legacy/useSignUp.d.ts
|
|
49
51
|
/**
|
|
50
52
|
* The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
51
53
|
*
|
|
@@ -91,5 +93,6 @@ declare const useSignIn: () => UseSignInReturn;
|
|
|
91
93
|
* ```empty```
|
|
92
94
|
*/
|
|
93
95
|
declare const useSignUp: () => UseSignUpReturn;
|
|
94
|
-
|
|
96
|
+
//#endregion
|
|
95
97
|
export { useSignIn, useSignUp };
|
|
98
|
+
//# sourceMappingURL=legacy.d.mts.map
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,48 +1,132 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useAssertWrappedByClerkProvider,
|
|
3
|
-
useIsomorphicClerkContext
|
|
4
|
-
} from "./chunk-RQWALB2R.mjs";
|
|
5
|
-
import "./chunk-E5QRIS4Z.mjs";
|
|
6
|
-
|
|
7
|
-
// src/hooks/legacy/useSignIn.ts
|
|
1
|
+
import { n as useIsomorphicClerkContext, t as useAssertWrappedByClerkProvider$1 } from "./useAssertWrappedByClerkProvider-GaNwZpWo.mjs";
|
|
8
2
|
import { __internal_useClientBase } from "@clerk/shared/react";
|
|
9
3
|
import { eventMethodCalled } from "@clerk/shared/telemetry";
|
|
10
|
-
var useSignIn = () => {
|
|
11
|
-
var _a;
|
|
12
|
-
useAssertWrappedByClerkProvider("useSignIn");
|
|
13
|
-
const isomorphicClerk = useIsomorphicClerkContext();
|
|
14
|
-
const client = __internal_useClientBase();
|
|
15
|
-
(_a = isomorphicClerk.telemetry) == null ? void 0 : _a.record(eventMethodCalled("useSignIn"));
|
|
16
|
-
if (!client) {
|
|
17
|
-
return { isLoaded: false, signIn: void 0, setActive: void 0 };
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
isLoaded: true,
|
|
21
|
-
signIn: client.signIn,
|
|
22
|
-
setActive: isomorphicClerk.setActive
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
4
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
5
|
+
//#region src/hooks/legacy/useSignIn.ts
|
|
6
|
+
/**
|
|
7
|
+
* The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
8
|
+
*
|
|
9
|
+
* @unionReturnHeadings
|
|
10
|
+
* ["Initialization", "Loaded"]
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ### Check the current state of a sign-in
|
|
14
|
+
*
|
|
15
|
+
* The following example uses the `useSignIn()` hook to access the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state.
|
|
16
|
+
*
|
|
17
|
+
* <Tabs items='React,Next.js'>
|
|
18
|
+
* <Tab>
|
|
19
|
+
*
|
|
20
|
+
* ```tsx {{ filename: 'src/pages/SignInPage.tsx' }}
|
|
21
|
+
* import { useSignIn } from '@clerk/react'
|
|
22
|
+
*
|
|
23
|
+
* export default function SignInPage() {
|
|
24
|
+
* const { isLoaded, signIn } = useSignIn()
|
|
25
|
+
*
|
|
26
|
+
* if (!isLoaded) {
|
|
27
|
+
* // Handle loading state
|
|
28
|
+
* return null
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* return <div>The current sign-in attempt status is {signIn?.status}.</div>
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* </Tab>
|
|
36
|
+
* <Tab>
|
|
37
|
+
*
|
|
38
|
+
* {@include ../../../docs/legacy-use-sign-in.md#nextjs-01}
|
|
39
|
+
*
|
|
40
|
+
* </Tab>
|
|
41
|
+
* </Tabs>
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ### Create a custom sign-in flow with `useSignIn()`
|
|
45
|
+
*
|
|
46
|
+
* The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
47
|
+
*
|
|
48
|
+
* ```empty```
|
|
49
|
+
*/
|
|
50
|
+
const useSignIn = () => {
|
|
51
|
+
useAssertWrappedByClerkProvider$1("useSignIn");
|
|
52
|
+
const isomorphicClerk = useIsomorphicClerkContext();
|
|
53
|
+
const client = __internal_useClientBase();
|
|
54
|
+
isomorphicClerk.telemetry?.record(eventMethodCalled("useSignIn"));
|
|
55
|
+
if (!client) return {
|
|
56
|
+
isLoaded: false,
|
|
57
|
+
signIn: void 0,
|
|
58
|
+
setActive: void 0
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
isLoaded: true,
|
|
62
|
+
signIn: client.signIn,
|
|
63
|
+
setActive: isomorphicClerk.setActive
|
|
64
|
+
};
|
|
43
65
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/hooks/legacy/useSignUp.ts
|
|
69
|
+
/**
|
|
70
|
+
* The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
71
|
+
*
|
|
72
|
+
* @unionReturnHeadings
|
|
73
|
+
* ["Initialization", "Loaded"]
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ### Check the current state of a sign-up
|
|
77
|
+
*
|
|
78
|
+
* The following example uses the `useSignUp()` hook to access the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state.
|
|
79
|
+
*
|
|
80
|
+
* <Tabs items='React,Next.js'>
|
|
81
|
+
* <Tab>
|
|
82
|
+
*
|
|
83
|
+
* ```tsx {{ filename: 'src/pages/SignUpPage.tsx' }}
|
|
84
|
+
* import { useSignUp } from '@clerk/react'
|
|
85
|
+
*
|
|
86
|
+
* export default function SignUpPage() {
|
|
87
|
+
* const { isLoaded, signUp } = useSignUp()
|
|
88
|
+
*
|
|
89
|
+
* if (!isLoaded) {
|
|
90
|
+
* // Handle loading state
|
|
91
|
+
* return null
|
|
92
|
+
* }
|
|
93
|
+
*
|
|
94
|
+
* return <div>The current sign-up attempt status is {signUp?.status}.</div>
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* </Tab>
|
|
99
|
+
* <Tab>
|
|
100
|
+
*
|
|
101
|
+
* {@include ../../../docs/legacy-use-sign-up.md#nextjs-01}
|
|
102
|
+
*
|
|
103
|
+
* </Tab>
|
|
104
|
+
* </Tabs>
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ### Create a custom sign-up flow with `useSignUp()`
|
|
108
|
+
*
|
|
109
|
+
* The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).
|
|
110
|
+
*
|
|
111
|
+
* ```empty```
|
|
112
|
+
*/
|
|
113
|
+
const useSignUp = () => {
|
|
114
|
+
useAssertWrappedByClerkProvider$1("useSignUp");
|
|
115
|
+
const isomorphicClerk = useIsomorphicClerkContext();
|
|
116
|
+
const client = __internal_useClientBase();
|
|
117
|
+
isomorphicClerk.telemetry?.record(eventMethodCalled("useSignUp"));
|
|
118
|
+
if (!client) return {
|
|
119
|
+
isLoaded: false,
|
|
120
|
+
signUp: void 0,
|
|
121
|
+
setActive: void 0
|
|
122
|
+
};
|
|
123
|
+
return {
|
|
124
|
+
isLoaded: true,
|
|
125
|
+
signUp: client.signUp,
|
|
126
|
+
setActive: isomorphicClerk.setActive
|
|
127
|
+
};
|
|
47
128
|
};
|
|
129
|
+
|
|
130
|
+
//#endregion
|
|
131
|
+
export { useSignIn, useSignUp };
|
|
48
132
|
//# sourceMappingURL=legacy.mjs.map
|
package/dist/legacy.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/legacy/useSignIn.ts","../src/hooks/legacy/useSignUp.ts"],"sourcesContent":["import { __internal_useClientBase } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignInReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-in\n *\n * The following example uses the `useSignIn()` hook to access the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignInPage.tsx' }}\n * import { useSignIn } from '@clerk/react'\n *\n * export default function SignInPage() {\n * const { isLoaded, signIn } = useSignIn()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-in attempt status is {signIn?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../../docs/legacy-use-sign-in.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-in flow with `useSignIn()`\n *\n * The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignIn = (): UseSignInReturn => {\n useAssertWrappedByClerkProvider('useSignIn');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = __internal_useClientBase();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignIn'));\n\n if (!client) {\n return { isLoaded: false, signIn: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signIn: client.signIn,\n setActive: isomorphicClerk.setActive,\n };\n};\n","import { __internal_useClientBase } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignUpReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-up\n *\n * The following example uses the `useSignUp()` hook to access the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignUpPage.tsx' }}\n * import { useSignUp } from '@clerk/react'\n *\n * export default function SignUpPage() {\n * const { isLoaded, signUp } = useSignUp()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-up attempt status is {signUp?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../../docs/legacy-use-sign-up.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-up flow with `useSignUp()`\n *\n * The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignUp = (): UseSignUpReturn => {\n useAssertWrappedByClerkProvider('useSignUp');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = __internal_useClientBase();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignUp'));\n\n if (!client) {\n return { isLoaded: false, signUp: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signUp: client.signUp,\n setActive: isomorphicClerk.setActive,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"legacy.mjs","names":[],"sources":["../src/hooks/legacy/useSignIn.ts","../src/hooks/legacy/useSignUp.ts"],"sourcesContent":["import { __internal_useClientBase } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignInReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignIn()` hook provides access to the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-in\n *\n * The following example uses the `useSignIn()` hook to access the [`SignIn`](https://clerk.com/docs/reference/objects/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignInPage.tsx' }}\n * import { useSignIn } from '@clerk/react'\n *\n * export default function SignInPage() {\n * const { isLoaded, signIn } = useSignIn()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-in attempt status is {signIn?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../../docs/legacy-use-sign-in.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-in flow with `useSignIn()`\n *\n * The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignIn = (): UseSignInReturn => {\n useAssertWrappedByClerkProvider('useSignIn');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = __internal_useClientBase();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignIn'));\n\n if (!client) {\n return { isLoaded: false, signIn: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signIn: client.signIn,\n setActive: isomorphicClerk.setActive,\n };\n};\n","import { __internal_useClientBase } from '@clerk/shared/react';\nimport { eventMethodCalled } from '@clerk/shared/telemetry';\nimport type { UseSignUpReturn } from '@clerk/shared/types';\n\nimport { useIsomorphicClerkContext } from '../../contexts/IsomorphicClerkContext';\nimport { useAssertWrappedByClerkProvider } from '../useAssertWrappedByClerkProvider';\n\n/**\n * The `useSignUp()` hook provides access to the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * @unionReturnHeadings\n * [\"Initialization\", \"Loaded\"]\n *\n * @example\n * ### Check the current state of a sign-up\n *\n * The following example uses the `useSignUp()` hook to access the [`SignUp`](https://clerk.com/docs/reference/objects/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state.\n *\n * <Tabs items='React,Next.js'>\n * <Tab>\n *\n * ```tsx {{ filename: 'src/pages/SignUpPage.tsx' }}\n * import { useSignUp } from '@clerk/react'\n *\n * export default function SignUpPage() {\n * const { isLoaded, signUp } = useSignUp()\n *\n * if (!isLoaded) {\n * // Handle loading state\n * return null\n * }\n *\n * return <div>The current sign-up attempt status is {signUp?.status}.</div>\n * }\n * ```\n *\n * </Tab>\n * <Tab>\n *\n * {@include ../../../docs/legacy-use-sign-up.md#nextjs-01}\n *\n * </Tab>\n * </Tabs>\n *\n * @example\n * ### Create a custom sign-up flow with `useSignUp()`\n *\n * The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](https://clerk.com/docs/guides/development/custom-flows/overview).\n *\n * ```empty```\n */\nexport const useSignUp = (): UseSignUpReturn => {\n useAssertWrappedByClerkProvider('useSignUp');\n\n const isomorphicClerk = useIsomorphicClerkContext();\n const client = __internal_useClientBase();\n\n isomorphicClerk.telemetry?.record(eventMethodCalled('useSignUp'));\n\n if (!client) {\n return { isLoaded: false, signUp: undefined, setActive: undefined };\n }\n\n return {\n isLoaded: true,\n signUp: client.signUp,\n setActive: isomorphicClerk.setActive,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAa,kBAAmC;CAC9C,kCAAgC,WAAW;CAE3C,MAAM,kBAAkB,0BAA0B;CAClD,MAAM,SAAS,yBAAyB;CAExC,gBAAgB,WAAW,OAAO,kBAAkB,WAAW,CAAC;CAEhE,IAAI,CAAC,QACH,OAAO;EAAE,UAAU;EAAO,QAAQ;EAAW,WAAW;CAAU;CAGpE,OAAO;EACL,UAAU;EACV,QAAQ,OAAO;EACf,WAAW,gBAAgB;CAC7B;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACjBA,MAAa,kBAAmC;CAC9C,kCAAgC,WAAW;CAE3C,MAAM,kBAAkB,0BAA0B;CAClD,MAAM,SAAS,yBAAyB;CAExC,gBAAgB,WAAW,OAAO,kBAAkB,WAAW,CAAC;CAEhE,IAAI,CAAC,QACH,OAAO;EAAE,UAAU;EAAO,QAAQ;EAAW,WAAW;CAAU;CAGpE,OAAO;EACL,UAAU;EACV,QAAQ,OAAO;EACf,WAAW,gBAAgB;CAC7B;AACF"}
|