@insforge/react 1.1.2-dev.0 → 1.1.2-dev.3

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.
@@ -51,6 +51,7 @@ interface SignUpProps {
51
51
  signInUrl?: string;
52
52
  dividerText?: string;
53
53
  onError?: (error: Error) => void;
54
+ emailRedirectTo?: string;
54
55
  }
55
56
  /**
56
57
  * Pre-built sign-up component with full authentication logic.
@@ -64,7 +65,7 @@ interface SignUpProps {
64
65
  *
65
66
  * ```
66
67
  */
67
- declare function SignUp({ onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
68
+ declare function SignUp({ onError, emailRedirectTo, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
68
69
 
69
70
  interface ForgotPasswordProps {
70
71
  /** Text customization */
@@ -51,6 +51,7 @@ interface SignUpProps {
51
51
  signInUrl?: string;
52
52
  dividerText?: string;
53
53
  onError?: (error: Error) => void;
54
+ emailRedirectTo?: string;
54
55
  }
55
56
  /**
56
57
  * Pre-built sign-up component with full authentication logic.
@@ -64,7 +65,7 @@ interface SignUpProps {
64
65
  *
65
66
  * ```
66
67
  */
67
- declare function SignUp({ onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
68
+ declare function SignUp({ onError, emailRedirectTo, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
68
69
 
69
70
  interface ForgotPasswordProps {
70
71
  /** Text customization */
@@ -1750,7 +1750,7 @@ function useInsforge() {
1750
1750
  signOut: () => Promise.resolve(),
1751
1751
  updateUser: () => Promise.resolve({ error: "SSR mode" }),
1752
1752
  reloadAuth: () => Promise.resolve({ success: false, error: "SSR mode" }),
1753
- sendVerificationEmail: () => Promise.resolve(null),
1753
+ resendVerificationEmail: () => Promise.resolve(null),
1754
1754
  sendResetPasswordEmail: () => Promise.resolve(null),
1755
1755
  resetPassword: () => Promise.resolve(null),
1756
1756
  verifyEmail: () => Promise.resolve({ error: "SSR mode" }),
@@ -3331,7 +3331,7 @@ function AuthEmailVerificationStep({
3331
3331
  onVerifyCode,
3332
3332
  emailSent = false
3333
3333
  }) {
3334
- const { sendVerificationEmail } = useInsforge();
3334
+ const { resendVerificationEmail } = useInsforge();
3335
3335
  const [resendDisabled, setResendDisabled] = useState(emailSent ? true : false);
3336
3336
  const [resendCountdown, setResendCountdown] = useState(emailSent ? 60 : 0);
3337
3337
  const [isSending, setIsSending] = useState(false);
@@ -3358,7 +3358,7 @@ function AuthEmailVerificationStep({
3358
3358
  setResendCountdown(60);
3359
3359
  setIsSending(true);
3360
3360
  try {
3361
- await sendVerificationEmail(email);
3361
+ await resendVerificationEmail(email);
3362
3362
  } catch {
3363
3363
  setResendDisabled(false);
3364
3364
  setResendCountdown(0);
@@ -3846,7 +3846,7 @@ function createPasswordSchema(options) {
3846
3846
  return schema;
3847
3847
  }
3848
3848
  createPasswordSchema();
3849
- function SignUp({ onError, ...uiProps }) {
3849
+ function SignUp({ onError, emailRedirectTo, ...uiProps }) {
3850
3850
  const { signUp, verifyEmail, loginWithOAuth } = useInsforge();
3851
3851
  const { authConfig } = usePublicAuthConfig();
3852
3852
  const [email, setEmail] = useState("");
@@ -3888,7 +3888,7 @@ function SignUp({ onError, ...uiProps }) {
3888
3888
  return;
3889
3889
  }
3890
3890
  try {
3891
- const result = await signUp(emailValidation.data, password);
3891
+ const result = await signUp(emailValidation.data, password, { emailRedirectTo });
3892
3892
  if ("error" in result) {
3893
3893
  throw new Error(result.error);
3894
3894
  }