@umituz/react-native-auth 4.3.9 → 4.3.11

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-auth",
3
- "version": "4.3.9",
3
+ "version": "4.3.11",
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",
@@ -67,8 +67,22 @@ async function doInitializeAuth(
67
67
  authConfig,
68
68
  } = options;
69
69
 
70
- const auth = getFirebaseAuth();
71
- if (!auth) return { success: false };
70
+ let auth;
71
+ try {
72
+ auth = getFirebaseAuth();
73
+ } catch {
74
+ if (__DEV__) {
75
+ console.warn('[Auth] Firebase Auth not available — skipping auth initialization.');
76
+ }
77
+ return { success: false };
78
+ }
79
+
80
+ if (!auth) {
81
+ if (__DEV__) {
82
+ console.warn('[Auth] Firebase Auth not initialized — skipping auth initialization.');
83
+ }
84
+ return { success: false };
85
+ }
72
86
 
73
87
  configureUserDocumentService({
74
88
  collectionName: userCollection,
@@ -76,7 +76,7 @@ async function performAnonymousSignIn(
76
76
  } catch (error) {
77
77
  // If not last attempt, wait and retry
78
78
  if (attempt < maxRetries - 1) {
79
- await new Promise(resolve => setTimeout(resolve, retryDelay));
79
+ await new Promise(resolve => setTimeout(() => resolve(undefined), retryDelay));
80
80
  continue;
81
81
  }
82
82
 
@@ -73,7 +73,7 @@ export function createAuthInitModule(
73
73
  storageProvider,
74
74
  onRestorePurchases,
75
75
  onUserConverted,
76
- critical = true,
76
+ critical = false,
77
77
  dependsOn = ['firebase'],
78
78
  } = config;
79
79
 
@@ -78,6 +78,6 @@ export function shouldCloseAfterAuth(
78
78
  export function executeAfterAuth(
79
79
  callback: () => void,
80
80
  delay: number = 100
81
- ): NodeJS.Timeout {
81
+ ): ReturnType<typeof setTimeout> {
82
82
  return setTimeout(callback, delay);
83
83
  }