@insforge/react 0.7.0 → 0.7.1

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/index.d.cts CHANGED
@@ -34,6 +34,13 @@ interface InsforgeProviderProps {
34
34
  * @internal - Not intended for public use, used by Next.js package
35
35
  */
36
36
  initialState?: InitialAuthState;
37
+ /**
38
+ * Internal use only - enables hosted auth mode for centralized auth pages.
39
+ * When true, disables automatic redirects to prevent security issues.
40
+ * @internal - Never set to true in user applications
41
+ * @default false
42
+ */
43
+ hostedMode?: boolean;
37
44
  }
38
45
  /**
39
46
  * Unified Insforge Provider - manages authentication state and configuration
@@ -73,7 +80,7 @@ interface InsforgeProviderProps {
73
80
  * </InsforgeProvider>
74
81
  * ```
75
82
  */
76
- declare function InsforgeProviderCore({ children, baseUrl, afterSignInUrl, onAuthChange, onSignIn, onSignOut, initialState, }: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
83
+ declare function InsforgeProviderCore({ children, baseUrl, afterSignInUrl, onAuthChange, onSignIn, onSignOut, initialState, hostedMode, }: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
77
84
  declare function InsforgeProvider(props: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
78
85
  /**
79
86
  * Hook to access Insforge context
package/dist/index.d.ts CHANGED
@@ -34,6 +34,13 @@ interface InsforgeProviderProps {
34
34
  * @internal - Not intended for public use, used by Next.js package
35
35
  */
36
36
  initialState?: InitialAuthState;
37
+ /**
38
+ * Internal use only - enables hosted auth mode for centralized auth pages.
39
+ * When true, disables automatic redirects to prevent security issues.
40
+ * @internal - Never set to true in user applications
41
+ * @default false
42
+ */
43
+ hostedMode?: boolean;
37
44
  }
38
45
  /**
39
46
  * Unified Insforge Provider - manages authentication state and configuration
@@ -73,7 +80,7 @@ interface InsforgeProviderProps {
73
80
  * </InsforgeProvider>
74
81
  * ```
75
82
  */
76
- declare function InsforgeProviderCore({ children, baseUrl, afterSignInUrl, onAuthChange, onSignIn, onSignOut, initialState, }: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
83
+ declare function InsforgeProviderCore({ children, baseUrl, afterSignInUrl, onAuthChange, onSignIn, onSignOut, initialState, hostedMode, }: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
77
84
  declare function InsforgeProvider(props: InsforgeProviderProps): react_jsx_runtime.JSX.Element;
78
85
  /**
79
86
  * Hook to access Insforge context
package/dist/index.js CHANGED
@@ -464,6 +464,9 @@ var InsforgeManager = class _InsforgeManager {
464
464
  // Handle auth redirect after successful authentication
465
465
  // Works for all auth sources: OAuth providers, cloud hosting sign-in, email verification
466
466
  handleAuthRedirect(isLoaded, user) {
467
+ if (this.config.hostedMode) {
468
+ return false;
469
+ }
467
470
  if (!isLoaded || this.hasProcessedCallbackRef) {
468
471
  return false;
469
472
  }
@@ -507,7 +510,8 @@ function InsforgeProviderCore({
507
510
  onAuthChange,
508
511
  onSignIn,
509
512
  onSignOut,
510
- initialState
513
+ initialState,
514
+ hostedMode = false
511
515
  }) {
512
516
  const manager = useMemo(
513
517
  () => InsforgeManager.getInstance({
@@ -515,9 +519,10 @@ function InsforgeProviderCore({
515
519
  afterSignInUrl,
516
520
  onAuthChange,
517
521
  onSignIn,
518
- onSignOut
522
+ onSignOut,
523
+ hostedMode
519
524
  }),
520
- [baseUrl, afterSignInUrl, onAuthChange, onSignIn, onSignOut]
525
+ [baseUrl, afterSignInUrl, onAuthChange, onSignIn, onSignOut, hostedMode]
521
526
  );
522
527
  if (initialState) {
523
528
  const currentState = manager.getState();