@insforge/react 0.2.7 → 0.2.9

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.
@@ -12,16 +12,14 @@ import '@insforge/shared-schemas';
12
12
  * @component
13
13
  * @example
14
14
  * ```tsx
15
- * <SignIn afterSignInUrl="/dashboard" />
16
- *
17
- * // With custom callbacks
18
15
  * <SignIn
16
+ * afterSignInUrl="/auth/callback"
19
17
  * onSuccess={(user) => console.log('Signed in:', user)}
20
18
  * onError={(error) => console.error('Error:', error)}
21
19
  * />
22
20
  * ```
23
21
  */
24
- declare function SignIn({ onSuccess, onError, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
22
+ declare function SignIn({ afterSignInUrl, onSuccess, onError, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
25
23
 
26
24
  /**
27
25
  * Pre-built sign-up component with full authentication logic.
@@ -29,16 +27,15 @@ declare function SignIn({ onSuccess, onError, ...uiProps }: SignInProps): react_
29
27
  * @component
30
28
  * @example
31
29
  * ```tsx
32
- * <SignUp afterSignUpUrl="/onboarding" />
33
- *
34
- * // With custom callbacks
35
30
  * <SignUp
31
+ * afterSignUpUrl="/auth/callback"
36
32
  * onSuccess={(user) => console.log('Signed up:', user)}
37
33
  * onError={(error) => console.error('Error:', error)}
38
34
  * />
35
+ *
39
36
  * ```
40
37
  */
41
- declare function SignUp({ onSuccess, onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
38
+ declare function SignUp({ afterSignUpUrl, onSuccess, onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
42
39
 
43
40
  /**
44
41
  * User profile button with dropdown menu and sign-out functionality.
@@ -12,16 +12,14 @@ import '@insforge/shared-schemas';
12
12
  * @component
13
13
  * @example
14
14
  * ```tsx
15
- * <SignIn afterSignInUrl="/dashboard" />
16
- *
17
- * // With custom callbacks
18
15
  * <SignIn
16
+ * afterSignInUrl="/auth/callback"
19
17
  * onSuccess={(user) => console.log('Signed in:', user)}
20
18
  * onError={(error) => console.error('Error:', error)}
21
19
  * />
22
20
  * ```
23
21
  */
24
- declare function SignIn({ onSuccess, onError, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
22
+ declare function SignIn({ afterSignInUrl, onSuccess, onError, ...uiProps }: SignInProps): react_jsx_runtime.JSX.Element | null;
25
23
 
26
24
  /**
27
25
  * Pre-built sign-up component with full authentication logic.
@@ -29,16 +27,15 @@ declare function SignIn({ onSuccess, onError, ...uiProps }: SignInProps): react_
29
27
  * @component
30
28
  * @example
31
29
  * ```tsx
32
- * <SignUp afterSignUpUrl="/onboarding" />
33
- *
34
- * // With custom callbacks
35
30
  * <SignUp
31
+ * afterSignUpUrl="/auth/callback"
36
32
  * onSuccess={(user) => console.log('Signed up:', user)}
37
33
  * onError={(error) => console.error('Error:', error)}
38
34
  * />
35
+ *
39
36
  * ```
40
37
  */
41
- declare function SignUp({ onSuccess, onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
38
+ declare function SignUp({ afterSignUpUrl, onSuccess, onError, ...uiProps }: SignUpProps): react_jsx_runtime.JSX.Element | null;
42
39
 
43
40
  /**
44
41
  * User profile button with dropdown menu and sign-out functionality.
@@ -911,6 +911,7 @@ function SignInForm({
911
911
  );
912
912
  }
913
913
  function SignIn({
914
+ afterSignInUrl,
914
915
  onSuccess,
915
916
  onError,
916
917
  ...uiProps
@@ -950,10 +951,9 @@ function SignIn({
950
951
  try {
951
952
  setOauthLoading(provider);
952
953
  setError("");
953
- const redirectTo = `${window.location.origin}/auth/callback`;
954
954
  await insforge.auth.signInWithOAuth({
955
955
  provider,
956
- redirectTo
956
+ redirectTo: afterSignInUrl
957
957
  });
958
958
  } catch (err) {
959
959
  const errorMessage = err.message || `${provider} sign in failed`;
@@ -1132,6 +1132,7 @@ function SignUpForm({
1132
1132
  );
1133
1133
  }
1134
1134
  function SignUp({
1135
+ afterSignUpUrl,
1135
1136
  onSuccess,
1136
1137
  onError,
1137
1138
  ...uiProps
@@ -1176,10 +1177,9 @@ function SignUp({
1176
1177
  try {
1177
1178
  setOauthLoading(provider);
1178
1179
  setError("");
1179
- const redirectTo = `${window.location.origin}/auth/callback`;
1180
1180
  await insforge.auth.signInWithOAuth({
1181
1181
  provider,
1182
- redirectTo
1182
+ redirectTo: afterSignUpUrl
1183
1183
  });
1184
1184
  } catch (err) {
1185
1185
  const errorMessage = err.message || `${provider} sign up failed`;