@umituz/react-native-auth 3.6.24 → 3.6.25

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,11 +1,11 @@
1
1
  {
2
2
  "name": "@umituz/react-native-auth",
3
- "version": "3.6.24",
3
+ "version": "3.6.25",
4
4
  "description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
7
7
  "scripts": {
8
- "typecheck": "tsc --noEmit",
8
+ "typecheck": "tsc --noEmit --skipLibCheck",
9
9
  "lint": "eslint src --ext .ts,.tsx --max-warnings 0",
10
10
  "lint:fix": "eslint src --ext .ts,.tsx --fix",
11
11
  "version:patch": "npm version patch -m 'chore: release v%s'",
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { initializeAuth } from '../infrastructure/services/initializeAuth';
7
7
  import type { InitializeAuthOptions } from '../infrastructure/services/initializeAuth';
8
- import { SubscriptionManager } from '@umituz/react-native-subscription';
9
8
 
10
9
  declare const __DEV__: boolean;
11
10
 
@@ -43,10 +42,10 @@ export interface AuthInitModuleConfig {
43
42
  storageProvider?: InitializeAuthOptions['storageProvider'];
44
43
 
45
44
  /**
46
- * Whether to restore purchases after user conversion
47
- * @default true
45
+ * Callback to restore purchases after user conversion
46
+ * If provided, will be called after anonymous user converts to authenticated
48
47
  */
49
- restorePurchasesOnConversion?: boolean;
48
+ onRestorePurchases?: () => Promise<void>;
50
49
 
51
50
  /**
52
51
  * Custom callback when user converts from anonymous to authenticated
@@ -96,7 +95,7 @@ export function createAuthInitModule(
96
95
  autoAnonymousSignIn = true,
97
96
  collectExtras,
98
97
  storageProvider,
99
- restorePurchasesOnConversion = true,
98
+ onRestorePurchases,
100
99
  onUserConverted,
101
100
  critical = true,
102
101
  dependsOn = ['firebase'],
@@ -121,12 +120,12 @@ export function createAuthInitModule(
121
120
  });
122
121
  }
123
122
 
124
- // Restore purchases after conversion
125
- if (restorePurchasesOnConversion) {
123
+ // Restore purchases after conversion (if callback provided)
124
+ if (onRestorePurchases) {
126
125
  try {
127
- const result = await SubscriptionManager.restore();
126
+ await onRestorePurchases();
128
127
  if (typeof __DEV__ !== 'undefined' && __DEV__) {
129
- console.log('[createAuthInitModule] Restore purchases result:', result);
128
+ console.log('[createAuthInitModule] Purchases restored');
130
129
  }
131
130
  } catch (error) {
132
131
  if (typeof __DEV__ !== 'undefined' && __DEV__) {