@erikey/react 0.4.35 → 0.4.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erikey/react",
3
- "version": "0.4.35",
3
+ "version": "0.4.36",
4
4
  "description": "React SDK for Erikey - B2B authentication and user management. UI components based on better-auth-ui.",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -40,7 +40,8 @@ export interface AuthFlowProps
40
40
  initialView?: AuthFlowView
41
41
  /**
42
42
  * URL to redirect to after successful authentication.
43
- * In "internal" mode, called after AUTH_SUCCESS event.
43
+ * Used by OAuth callbacks and underlying auth forms.
44
+ * In "internal" mode, session state change triggers re-render automatically.
44
45
  */
45
46
  redirectTo?: string
46
47
  /**
@@ -295,16 +296,11 @@ export function AuthFlow({
295
296
  // Forward to user's handler
296
297
  onEvent?.(event)
297
298
 
298
- // In internal mode, handle AUTH_SUCCESS by redirecting
299
- if (mode === "internal" && event.type === "AUTH_SUCCESS") {
300
- if (externalNavigate) {
301
- externalNavigate(redirectTo)
302
- } else {
303
- window.location.href = redirectTo
304
- }
305
- }
299
+ // In internal mode, don't auto-redirect on AUTH_SUCCESS
300
+ // Let React re-render based on session state (useSession hook)
301
+ // User can handle AUTH_SUCCESS in onEvent if custom behavior needed
306
302
  },
307
- [onEvent, mode, redirectTo, externalNavigate]
303
+ [onEvent]
308
304
  )
309
305
 
310
306
  // Get the view key for AuthView component