@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.cjs
CHANGED
|
@@ -1773,7 +1773,7 @@ function useInsforge() {
|
|
|
1773
1773
|
sendVerificationEmail: () => Promise.resolve(null),
|
|
1774
1774
|
sendResetPasswordEmail: () => Promise.resolve(null),
|
|
1775
1775
|
resetPassword: () => Promise.resolve(null),
|
|
1776
|
-
verifyEmail: () => Promise.resolve(
|
|
1776
|
+
verifyEmail: () => Promise.resolve({ error: "SSR mode" }),
|
|
1777
1777
|
exchangeResetPasswordToken: () => Promise.resolve({ error: { message: "SSR mode" } }),
|
|
1778
1778
|
loginWithOAuth: () => Promise.resolve(),
|
|
1779
1779
|
getPublicAuthConfig: () => Promise.resolve(null),
|
|
@@ -3670,8 +3670,7 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
3670
3670
|
}
|
|
3671
3671
|
throw new Error(result.error);
|
|
3672
3672
|
}
|
|
3673
|
-
const { user, accessToken, redirectTo } = result;
|
|
3674
|
-
const csrfToken = result.csrfToken;
|
|
3673
|
+
const { user, accessToken, redirectTo, csrfToken } = result;
|
|
3675
3674
|
if (user) {
|
|
3676
3675
|
const finalUrl = new URL(redirectTo || redirectUrl || "", window.location.origin);
|
|
3677
3676
|
finalUrl.searchParams.set("access_token", accessToken);
|
|
@@ -3697,7 +3696,7 @@ function SignIn({ onError, ...uiProps }) {
|
|
|
3697
3696
|
setError("");
|
|
3698
3697
|
try {
|
|
3699
3698
|
const result = await verifyEmail(code, email);
|
|
3700
|
-
if (
|
|
3699
|
+
if ("error" in result) {
|
|
3701
3700
|
throw new Error("Verification failed");
|
|
3702
3701
|
}
|
|
3703
3702
|
const finalUrl = new URL(result.redirectTo || redirectUrl || "", window.location.origin);
|
|
@@ -3913,7 +3912,7 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
3913
3912
|
if ("error" in result) {
|
|
3914
3913
|
throw new Error(result.error);
|
|
3915
3914
|
}
|
|
3916
|
-
if (result.requireEmailVerification
|
|
3915
|
+
if (result.requireEmailVerification) {
|
|
3917
3916
|
setStep("awaiting-verification");
|
|
3918
3917
|
setLoading(false);
|
|
3919
3918
|
return;
|
|
@@ -3944,7 +3943,7 @@ function SignUp({ onError, ...uiProps }) {
|
|
|
3944
3943
|
setError("");
|
|
3945
3944
|
try {
|
|
3946
3945
|
const result = await verifyEmail(code, email);
|
|
3947
|
-
if (
|
|
3946
|
+
if ("error" in result) {
|
|
3948
3947
|
throw new Error("Verification failed");
|
|
3949
3948
|
}
|
|
3950
3949
|
const finalUrl = new URL(result.redirectTo || redirectUrl || "", window.location.origin);
|
|
@@ -4528,8 +4527,8 @@ function VerifyEmail({ token: token2, onSuccess, onError, ...uiProps }) {
|
|
|
4528
4527
|
}
|
|
4529
4528
|
try {
|
|
4530
4529
|
const result = await verifyEmail(token2);
|
|
4531
|
-
if (
|
|
4532
|
-
const errorMessage = result
|
|
4530
|
+
if ("error" in result) {
|
|
4531
|
+
const errorMessage = result.error || "Email verification failed";
|
|
4533
4532
|
setError(errorMessage);
|
|
4534
4533
|
setStatus("error");
|
|
4535
4534
|
if (onError) {
|