azirid-react 0.10.0 → 0.10.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
@@ -235,6 +235,17 @@ interface AziridProviderProps {
235
235
  onError?: (error: string) => void;
236
236
  /** Callback when session expires and refresh fails */
237
237
  onSessionExpired?: () => void;
238
+ /**
239
+ * Called after any auth state change (login, signup, logout, token refresh).
240
+ * Use this in Next.js to call `router.refresh()` so server actions see updated cookies.
241
+ *
242
+ * @example
243
+ * ```tsx
244
+ * const router = useRouter()
245
+ * <AziridProvider onAuthStateChange={() => router.refresh()} />
246
+ * ```
247
+ */
248
+ onAuthStateChange?: () => void;
238
249
  /** Auto-bootstrap session on mount (default: true) */
239
250
  autoBootstrap?: boolean;
240
251
  /** Interval in ms for proactive token refresh (default: 50000 = 50 seconds). Set to 0 to disable. */
package/dist/index.d.ts CHANGED
@@ -235,6 +235,17 @@ interface AziridProviderProps {
235
235
  onError?: (error: string) => void;
236
236
  /** Callback when session expires and refresh fails */
237
237
  onSessionExpired?: () => void;
238
+ /**
239
+ * Called after any auth state change (login, signup, logout, token refresh).
240
+ * Use this in Next.js to call `router.refresh()` so server actions see updated cookies.
241
+ *
242
+ * @example
243
+ * ```tsx
244
+ * const router = useRouter()
245
+ * <AziridProvider onAuthStateChange={() => router.refresh()} />
246
+ * ```
247
+ */
248
+ onAuthStateChange?: () => void;
238
249
  /** Auto-bootstrap session on mount (default: true) */
239
250
  autoBootstrap?: boolean;
240
251
  /** Interval in ms for proactive token refresh (default: 50000 = 50 seconds). Set to 0 to disable. */
package/dist/index.js CHANGED
@@ -602,6 +602,7 @@ function useAuthMutations(deps) {
602
602
  updateAccessToken(normalizeToken(data));
603
603
  saveSessionTokens(data);
604
604
  setError(null);
605
+ props.onAuthStateChange?.();
605
606
  props.onLoginSuccess?.(data);
606
607
  },
607
608
  onError: (err) => {
@@ -619,6 +620,7 @@ function useAuthMutations(deps) {
619
620
  updateAccessToken(normalizeToken(data));
620
621
  saveSessionTokens(data);
621
622
  setError(null);
623
+ props.onAuthStateChange?.();
622
624
  props.onSignupSuccess?.(data);
623
625
  },
624
626
  onError: (err) => {
@@ -632,6 +634,7 @@ function useAuthMutations(deps) {
632
634
  clearSession();
633
635
  setError(null);
634
636
  queryClient.clear();
637
+ props.onAuthStateChange?.();
635
638
  props.onLogoutSuccess?.();
636
639
  }
637
640
  });
@@ -4341,7 +4344,7 @@ function usePasswordToggle() {
4341
4344
  }
4342
4345
 
4343
4346
  // src/index.ts
4344
- var SDK_VERSION = "0.10.0";
4347
+ var SDK_VERSION = "0.10.1";
4345
4348
 
4346
4349
  export { AuthForm, AziridProvider, BASE_PATHS, CheckoutButton, ForgotPasswordForm, InvoiceList, LoginForm, PATHS, PayButton, PayphoneCallback, PayphoneWidgetRenderer, PricingTable, ReferralCard, ReferralStats, ResetPasswordForm, SDK_VERSION, SignupForm, SubscriptionBadge, buildPaths, changePasswordSchema, cn, createAccessClient, createForgotPasswordSchema, createLoginSchema, createMutationHook, createResetPasswordConfirmSchema, createSignupSchema, en, es, forgotPasswordSchema, isAuthError, loginSchema, magicLinkRequestSchema, magicLinkVerifySchema, passkeyRegisterStartSchema, removeStyles, resetPasswordConfirmSchema, resolveMessages, signupSchema, socialLoginSchema, useAccessClient, useAzirid, useBootstrap, useBranding, useChangePassword, useCheckout, useFormState, useInvoices, useLogin, useLogout, useMagicLink, useMessages, usePasskeys, usePasswordReset, usePasswordToggle, usePayButton, usePaymentProviders, usePayphoneCheckout, usePayphoneConfirm, usePlans, useReferral, useReferralStats, useRefresh, useSession, useSignup, useSocialLogin, useSubmitTransferProof, useSubscription, useSwitchTenant, useTenantMembers, useTenants, useTransferPayment, useTransferProofs };
4347
4350
  //# sourceMappingURL=index.js.map