@insforge/react 0.2.5 → 0.2.7

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.
@@ -21,7 +21,7 @@ import '@insforge/shared-schemas';
21
21
  * />
22
22
  * ```
23
23
  */
24
- declare function SignIn({ afterSignInUrl, onSuccess, onError, onRedirect, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
24
+ declare function SignIn({ onSuccess, onError, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
25
25
 
26
26
  /**
27
27
  * Pre-built sign-up component with full authentication logic.
@@ -38,7 +38,7 @@ declare function SignIn({ afterSignInUrl, onSuccess, onError, onRedirect, ...uiP
38
38
  * />
39
39
  * ```
40
40
  */
41
- declare function SignUp({ afterSignUpUrl, onSuccess, onError, onRedirect, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
41
+ declare function SignUp({ onSuccess, onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
42
42
 
43
43
  /**
44
44
  * User profile button with dropdown menu and sign-out functionality.
@@ -21,7 +21,7 @@ import '@insforge/shared-schemas';
21
21
  * />
22
22
  * ```
23
23
  */
24
- declare function SignIn({ afterSignInUrl, onSuccess, onError, onRedirect, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
24
+ declare function SignIn({ onSuccess, onError, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
25
25
 
26
26
  /**
27
27
  * Pre-built sign-up component with full authentication logic.
@@ -38,7 +38,7 @@ declare function SignIn({ afterSignInUrl, onSuccess, onError, onRedirect, ...uiP
38
38
  * />
39
39
  * ```
40
40
  */
41
- declare function SignUp({ afterSignUpUrl, onSuccess, onError, onRedirect, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
41
+ declare function SignUp({ onSuccess, onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
42
42
 
43
43
  /**
44
44
  * User profile button with dropdown menu and sign-out functionality.
@@ -911,10 +911,8 @@ function SignInForm({
911
911
  );
912
912
  }
913
913
  function SignIn({
914
- afterSignInUrl = "/",
915
914
  onSuccess,
916
915
  onError,
917
- onRedirect,
918
916
  ...uiProps
919
917
  }) {
920
918
  const { signIn, baseUrl } = useInsforge();
@@ -940,11 +938,6 @@ function SignIn({
940
938
  if (onSuccess) {
941
939
  if (user) onSuccess(user, accessToken || "");
942
940
  }
943
- if (onRedirect) {
944
- onRedirect(afterSignInUrl);
945
- } else {
946
- window.location.href = afterSignInUrl;
947
- }
948
941
  } catch (err) {
949
942
  const errorMessage = err.message || "Sign in failed";
950
943
  setError(errorMessage);
@@ -958,7 +951,6 @@ function SignIn({
958
951
  setOauthLoading(provider);
959
952
  setError("");
960
953
  const redirectTo = `${window.location.origin}/auth/callback`;
961
- sessionStorage.setItem("oauth_final_destination", afterSignInUrl || "/");
962
954
  await insforge.auth.signInWithOAuth({
963
955
  provider,
964
956
  redirectTo
@@ -1140,10 +1132,8 @@ function SignUpForm({
1140
1132
  );
1141
1133
  }
1142
1134
  function SignUp({
1143
- afterSignUpUrl = "/",
1144
1135
  onSuccess,
1145
1136
  onError,
1146
- onRedirect,
1147
1137
  ...uiProps
1148
1138
  }) {
1149
1139
  const { signUp, baseUrl } = useInsforge();
@@ -1174,11 +1164,6 @@ function SignUp({
1174
1164
  if (onSuccess) {
1175
1165
  if (user) onSuccess(user, accessToken || "");
1176
1166
  }
1177
- if (onRedirect) {
1178
- onRedirect(afterSignUpUrl);
1179
- } else {
1180
- window.location.href = afterSignUpUrl;
1181
- }
1182
1167
  } catch (err) {
1183
1168
  const errorMessage = err.message || "Sign up failed";
1184
1169
  setError(errorMessage);
@@ -1192,7 +1177,6 @@ function SignUp({
1192
1177
  setOauthLoading(provider);
1193
1178
  setError("");
1194
1179
  const redirectTo = `${window.location.origin}/auth/callback`;
1195
- sessionStorage.setItem("oauth_final_destination", afterSignUpUrl || "/");
1196
1180
  await insforge.auth.signInWithOAuth({
1197
1181
  provider,
1198
1182
  redirectTo
@@ -1429,10 +1413,7 @@ function InsforgeCallback({
1429
1413
  }
1430
1414
  return;
1431
1415
  }
1432
- const accessToken = searchParams.get("access_token") || searchParams.get("auth_token");
1433
- const userId = searchParams.get("user_id");
1434
- const email = searchParams.get("email");
1435
- const name = searchParams.get("name");
1416
+ const accessToken = searchParams.get("access_token");
1436
1417
  if (!accessToken) {
1437
1418
  const errorMsg = "no_token";
1438
1419
  if (onError) {
@@ -1448,10 +1429,7 @@ function InsforgeCallback({
1448
1429
  return;
1449
1430
  }
1450
1431
  const result = await handleAuthCallback({
1451
- accessToken,
1452
- userId: userId || void 0,
1453
- email: email || void 0,
1454
- name: name || void 0
1432
+ accessToken
1455
1433
  });
1456
1434
  if (!result.success) {
1457
1435
  const errorMsg = result.error || "authentication_failed";