@umituz/react-native-subscription 2.14.19 → 2.14.20

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": "@umituz/react-native-subscription",
3
- "version": "2.14.19",
3
+ "version": "2.14.20",
4
4
  "description": "Complete subscription management with RevenueCat, paywall UI, and credits system for React Native apps",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -37,15 +37,19 @@ export const useAuthAwarePurchase = (): UseAuthAwarePurchaseResult => {
37
37
 
38
38
  const handlePurchase = useCallback(
39
39
  async (pkg: PurchasesPackage): Promise<boolean> => {
40
+ // SECURITY: Block purchase if auth provider not configured
40
41
  if (!globalAuthProvider) {
41
42
  if (__DEV__) {
42
- console.warn(
43
- "[useAuthAwarePurchase] Auth provider not configured. Call configureAuthProvider() at app start.",
43
+ console.error(
44
+ "[useAuthAwarePurchase] CRITICAL: Auth provider not configured. " +
45
+ "Call configureAuthProvider() at app start. Purchase blocked for security.",
44
46
  );
45
47
  }
46
- return purchasePackage(pkg);
48
+ // Block purchase - never allow without auth provider
49
+ return false;
47
50
  }
48
51
 
52
+ // Block purchase if user not authenticated (anonymous users cannot purchase)
49
53
  if (!globalAuthProvider.isAuthenticated()) {
50
54
  if (__DEV__) {
51
55
  console.log(
@@ -63,15 +67,19 @@ export const useAuthAwarePurchase = (): UseAuthAwarePurchaseResult => {
63
67
  );
64
68
 
65
69
  const handleRestore = useCallback(async (): Promise<boolean> => {
70
+ // SECURITY: Block restore if auth provider not configured
66
71
  if (!globalAuthProvider) {
67
72
  if (__DEV__) {
68
- console.warn(
69
- "[useAuthAwarePurchase] Auth provider not configured. Call configureAuthProvider() at app start.",
73
+ console.error(
74
+ "[useAuthAwarePurchase] CRITICAL: Auth provider not configured. " +
75
+ "Call configureAuthProvider() at app start. Restore blocked for security.",
70
76
  );
71
77
  }
72
- return restorePurchase();
78
+ // Block restore - never allow without auth provider
79
+ return false;
73
80
  }
74
81
 
82
+ // Block restore if user not authenticated
75
83
  if (!globalAuthProvider.isAuthenticated()) {
76
84
  if (__DEV__) {
77
85
  console.log(