@insforge/react 0.3.2 → 0.3.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.
package/dist/forms.mjs CHANGED
@@ -235,7 +235,7 @@ function AuthPasswordField({
235
235
  label,
236
236
  id,
237
237
  showStrengthIndicator = false,
238
- emailAuthConfig,
238
+ authConfig,
239
239
  forgotPasswordLink,
240
240
  value,
241
241
  appearance = {},
@@ -313,7 +313,7 @@ function AuthPasswordField({
313
313
  AuthPasswordStrengthIndicator,
314
314
  {
315
315
  password: String(value || ""),
316
- config: emailAuthConfig
316
+ config: authConfig
317
317
  }
318
318
  )
319
319
  ]
@@ -757,11 +757,7 @@ function AuthEmailVerificationStep({
757
757
  useEffect(() => {
758
758
  const sendInitialEmail = async () => {
759
759
  try {
760
- if (method === "code") {
761
- await insforge.auth.sendVerificationCode({ email });
762
- } else {
763
- await insforge.auth.sendVerificationLink({ email });
764
- }
760
+ await insforge.auth.sendVerificationEmail({ email });
765
761
  } catch {
766
762
  }
767
763
  };
@@ -787,11 +783,7 @@ function AuthEmailVerificationStep({
787
783
  setIsSending(true);
788
784
  setVerificationError("");
789
785
  try {
790
- if (method === "code") {
791
- await insforge.auth.sendVerificationCode({ email });
792
- } else {
793
- await insforge.auth.sendVerificationLink({ email });
794
- }
786
+ await insforge.auth.sendVerificationEmail({ email });
795
787
  } catch {
796
788
  setResendDisabled(false);
797
789
  setResendCountdown(0);
@@ -869,7 +861,7 @@ function SignInForm({
869
861
  oauthLoading = null,
870
862
  availableProviders = [],
871
863
  onOAuthClick,
872
- emailAuthConfig,
864
+ authConfig,
873
865
  appearance = {},
874
866
  title = "Welcome Back",
875
867
  subtitle = "Login to your account",
@@ -959,7 +951,7 @@ function SignInForm({
959
951
  onChange: (e) => onPasswordChange(e.target.value),
960
952
  required: true,
961
953
  autoComplete: "current-password",
962
- emailAuthConfig,
954
+ authConfig,
963
955
  forgotPasswordLink: forgotPasswordUrl ? {
964
956
  href: forgotPasswordUrl,
965
957
  text: forgotPasswordText
@@ -1034,7 +1026,7 @@ function SignUpForm({
1034
1026
  oauthLoading = null,
1035
1027
  availableProviders = [],
1036
1028
  onOAuthClick,
1037
- emailAuthConfig,
1029
+ authConfig,
1038
1030
  appearance = {},
1039
1031
  title = "Get Started",
1040
1032
  subtitle = "Create your account",
@@ -1121,10 +1113,10 @@ function SignUpForm({
1121
1113
  value: password,
1122
1114
  onChange: (e) => onPasswordChange(e.target.value),
1123
1115
  required: true,
1124
- minLength: emailAuthConfig.passwordMinLength,
1116
+ minLength: authConfig.passwordMinLength,
1125
1117
  autoComplete: "new-password",
1126
1118
  showStrengthIndicator: true,
1127
- emailAuthConfig,
1119
+ authConfig,
1128
1120
  appearance: {
1129
1121
  containerClassName: appearance.form?.passwordField?.container,
1130
1122
  labelClassName: appearance.form?.passwordField?.label,
@@ -1309,7 +1301,7 @@ function ResetPasswordForm({
1309
1301
  error,
1310
1302
  loading = false,
1311
1303
  success = false,
1312
- emailAuthConfig,
1304
+ authConfig,
1313
1305
  appearance = {},
1314
1306
  title = "Reset Password",
1315
1307
  subtitle = "Enter your new password below.",
@@ -1386,7 +1378,7 @@ function ResetPasswordForm({
1386
1378
  required: true,
1387
1379
  autoComplete: "new-password",
1388
1380
  showStrengthIndicator: true,
1389
- emailAuthConfig,
1381
+ authConfig,
1390
1382
  appearance: {
1391
1383
  containerClassName: appearance.form?.newPasswordField?.container,
1392
1384
  labelClassName: appearance.form?.newPasswordField?.label,
@@ -1404,7 +1396,7 @@ function ResetPasswordForm({
1404
1396
  onChange: (e) => onConfirmPasswordChange(e.target.value),
1405
1397
  required: true,
1406
1398
  autoComplete: "new-password",
1407
- emailAuthConfig,
1399
+ authConfig,
1408
1400
  appearance: {
1409
1401
  containerClassName: appearance.form?.confirmPasswordField?.container,
1410
1402
  labelClassName: appearance.form?.confirmPasswordField?.label,