@insforge/react 1.0.7 → 1.0.9-dev.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.
- package/dist/atoms.cjs +1 -1
- package/dist/atoms.cjs.map +1 -1
- package/dist/atoms.js +1 -1
- package/dist/atoms.js.map +1 -1
- package/dist/components.cjs +7 -8
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +0 -1
- package/dist/components.d.ts +0 -1
- package/dist/components.js +7 -8
- package/dist/components.js.map +1 -1
- package/dist/forms.cjs +1 -1
- package/dist/forms.cjs.map +1 -1
- package/dist/forms.js +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.cts +4 -5
- package/dist/hooks.d.ts +4 -5
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +30 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +30 -58
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/components.d.cts
CHANGED
package/dist/components.d.ts
CHANGED
package/dist/components.js
CHANGED
|
@@ -1752,7 +1752,7 @@ function useInsforge() {
|
|
|
1752
1752
|
sendVerificationEmail: () => Promise.resolve(null),
|
|
1753
1753
|
sendResetPasswordEmail: () => Promise.resolve(null),
|
|
1754
1754
|
resetPassword: () => Promise.resolve(null),
|
|
1755
|
-
verifyEmail: () => Promise.resolve(
|
|
1755
|
+
verifyEmail: () => Promise.resolve({ error: "SSR mode" }),
|
|
1756
1756
|
exchangeResetPasswordToken: () => Promise.resolve({ error: { message: "SSR mode" } }),
|
|
1757
1757
|
loginWithOAuth: () => Promise.resolve(),
|
|
1758
1758
|
getPublicAuthConfig: () => Promise.resolve(null),
|
|
@@ -3649,8 +3649,7 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
3649
3649
|
}
|
|
3650
3650
|
throw new Error(result.error);
|
|
3651
3651
|
}
|
|
3652
|
-
const { user, accessToken, redirectTo } = result;
|
|
3653
|
-
const csrfToken = result.csrfToken;
|
|
3652
|
+
const { user, accessToken, redirectTo, csrfToken } = result;
|
|
3654
3653
|
if (user) {
|
|
3655
3654
|
const finalUrl = new URL(redirectTo || redirectUrl || "", window.location.origin);
|
|
3656
3655
|
finalUrl.searchParams.set("access_token", accessToken);
|
|
@@ -3676,7 +3675,7 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
3676
3675
|
setError("");
|
|
3677
3676
|
try {
|
|
3678
3677
|
const result = await verifyEmail(code, email);
|
|
3679
|
-
if (
|
|
3678
|
+
if ("error" in result) {
|
|
3680
3679
|
throw new Error("Verification failed");
|
|
3681
3680
|
}
|
|
3682
3681
|
const finalUrl = new URL(result.redirectTo || redirectUrl || "", window.location.origin);
|
|
@@ -3892,7 +3891,7 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
3892
3891
|
if ("error" in result) {
|
|
3893
3892
|
throw new Error(result.error);
|
|
3894
3893
|
}
|
|
3895
|
-
if (result.requireEmailVerification
|
|
3894
|
+
if (result.requireEmailVerification) {
|
|
3896
3895
|
setStep("awaiting-verification");
|
|
3897
3896
|
setLoading(false);
|
|
3898
3897
|
return;
|
|
@@ -3923,7 +3922,7 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
3923
3922
|
setError("");
|
|
3924
3923
|
try {
|
|
3925
3924
|
const result = await verifyEmail(code, email);
|
|
3926
|
-
if (
|
|
3925
|
+
if ("error" in result) {
|
|
3927
3926
|
throw new Error("Verification failed");
|
|
3928
3927
|
}
|
|
3929
3928
|
const finalUrl = new URL(result.redirectTo || redirectUrl || "", window.location.origin);
|
|
@@ -4507,8 +4506,8 @@ function VerifyEmail({ token: token2, onSuccess, onError, ...uiProps }) {
|
|
|
4507
4506
|
}
|
|
4508
4507
|
try {
|
|
4509
4508
|
const result = await verifyEmail(token2);
|
|
4510
|
-
if (
|
|
4511
|
-
const errorMessage = result
|
|
4509
|
+
if ("error" in result) {
|
|
4510
|
+
const errorMessage = result.error || "Email verification failed";
|
|
4512
4511
|
setError(errorMessage);
|
|
4513
4512
|
setStatus("error");
|
|
4514
4513
|
if (onError) {
|