@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.
@@ -909,10 +909,8 @@ function SignInForm({
909
909
  );
910
910
  }
911
911
  function SignIn({
912
- afterSignInUrl = "/",
913
912
  onSuccess,
914
913
  onError,
915
- onRedirect,
916
914
  ...uiProps
917
915
  }) {
918
916
  const { signIn, baseUrl } = useInsforge();
@@ -938,11 +936,6 @@ function SignIn({
938
936
  if (onSuccess) {
939
937
  if (user) onSuccess(user, accessToken || "");
940
938
  }
941
- if (onRedirect) {
942
- onRedirect(afterSignInUrl);
943
- } else {
944
- window.location.href = afterSignInUrl;
945
- }
946
939
  } catch (err) {
947
940
  const errorMessage = err.message || "Sign in failed";
948
941
  setError(errorMessage);
@@ -956,7 +949,6 @@ function SignIn({
956
949
  setOauthLoading(provider);
957
950
  setError("");
958
951
  const redirectTo = `${window.location.origin}/auth/callback`;
959
- sessionStorage.setItem("oauth_final_destination", afterSignInUrl || "/");
960
952
  await insforge.auth.signInWithOAuth({
961
953
  provider,
962
954
  redirectTo
@@ -1138,10 +1130,8 @@ function SignUpForm({
1138
1130
  );
1139
1131
  }
1140
1132
  function SignUp({
1141
- afterSignUpUrl = "/",
1142
1133
  onSuccess,
1143
1134
  onError,
1144
- onRedirect,
1145
1135
  ...uiProps
1146
1136
  }) {
1147
1137
  const { signUp, baseUrl } = useInsforge();
@@ -1172,11 +1162,6 @@ function SignUp({
1172
1162
  if (onSuccess) {
1173
1163
  if (user) onSuccess(user, accessToken || "");
1174
1164
  }
1175
- if (onRedirect) {
1176
- onRedirect(afterSignUpUrl);
1177
- } else {
1178
- window.location.href = afterSignUpUrl;
1179
- }
1180
1165
  } catch (err) {
1181
1166
  const errorMessage = err.message || "Sign up failed";
1182
1167
  setError(errorMessage);
@@ -1190,7 +1175,6 @@ function SignUp({
1190
1175
  setOauthLoading(provider);
1191
1176
  setError("");
1192
1177
  const redirectTo = `${window.location.origin}/auth/callback`;
1193
- sessionStorage.setItem("oauth_final_destination", afterSignUpUrl || "/");
1194
1178
  await insforge.auth.signInWithOAuth({
1195
1179
  provider,
1196
1180
  redirectTo
@@ -1427,10 +1411,7 @@ function InsforgeCallback({
1427
1411
  }
1428
1412
  return;
1429
1413
  }
1430
- const accessToken = searchParams.get("access_token") || searchParams.get("auth_token");
1431
- const userId = searchParams.get("user_id");
1432
- const email = searchParams.get("email");
1433
- const name = searchParams.get("name");
1414
+ const accessToken = searchParams.get("access_token");
1434
1415
  if (!accessToken) {
1435
1416
  const errorMsg = "no_token";
1436
1417
  if (onError) {
@@ -1446,10 +1427,7 @@ function InsforgeCallback({
1446
1427
  return;
1447
1428
  }
1448
1429
  const result = await handleAuthCallback({
1449
- accessToken,
1450
- userId: userId || void 0,
1451
- email: email || void 0,
1452
- name: name || void 0
1430
+ accessToken
1453
1431
  });
1454
1432
  if (!result.success) {
1455
1433
  const errorMsg = result.error || "authentication_failed";