@umituz/react-native-firebase 2.4.61 → 2.4.62
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-firebase",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.62",
|
|
4
4
|
"description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { Auth } from "firebase/auth";
|
|
8
|
-
import {
|
|
8
|
+
import type { GoogleAuthResult } from "./google-auth.types";
|
|
9
9
|
import { googleAuthService } from "./google-auth.service";
|
|
10
10
|
|
|
11
11
|
// Conditional import - expo-web-browser is optional
|
|
@@ -34,11 +34,7 @@ export interface GoogleOAuthConfig {
|
|
|
34
34
|
|
|
35
35
|
function validateGoogleConfig(config?: GoogleOAuthConfig): boolean {
|
|
36
36
|
if (!config) return false;
|
|
37
|
-
return !!(
|
|
38
|
-
(config.iosClientId && config.iosClientId !== PLACEHOLDER_CLIENT_ID) ||
|
|
39
|
-
(config.webClientId && config.webClientId !== PLACEHOLDER_CLIENT_ID) ||
|
|
40
|
-
(config.androidClientId && config.androidClientId !== PLACEHOLDER_CLIENT_ID)
|
|
41
|
-
);
|
|
37
|
+
return !!(config.iosClientId || config.webClientId || config.androidClientId);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
/**
|
|
@@ -8,8 +8,6 @@ import { useState, useCallback, useEffect, useRef } from "react";
|
|
|
8
8
|
import { googleOAuthService } from "../../infrastructure/services/google-oauth.service";
|
|
9
9
|
import { getFirebaseAuth } from "../../infrastructure/config/FirebaseAuthClient";
|
|
10
10
|
import type { GoogleOAuthConfig } from "../../infrastructure/services/google-oauth.service";
|
|
11
|
-
import { PLACEHOLDER_CLIENT_ID } from "../../infrastructure/services/google-auth.types";
|
|
12
|
-
|
|
13
11
|
// Conditional import for expo-auth-session
|
|
14
12
|
interface AuthSessionResponse {
|
|
15
13
|
type: string;
|
|
@@ -66,11 +64,12 @@ export function useGoogleOAuth(config?: GoogleOAuthConfig): UseGoogleOAuthResult
|
|
|
66
64
|
|
|
67
65
|
// Call the Hook directly (only valid in React component)
|
|
68
66
|
// If expo-auth-session is not available, these will be null
|
|
67
|
+
// Empty strings are passed when config is missing to preserve hook call order (Rules of Hooks)
|
|
69
68
|
const [request, response, promptAsync] = isExpoAuthAvailable && ExpoAuthSession
|
|
70
69
|
? ExpoAuthSession.useAuthRequest({
|
|
71
|
-
iosClientId: config?.iosClientId
|
|
72
|
-
webClientId: config?.webClientId
|
|
73
|
-
androidClientId: config?.androidClientId
|
|
70
|
+
iosClientId: config?.iosClientId ?? "",
|
|
71
|
+
webClientId: config?.webClientId ?? "",
|
|
72
|
+
androidClientId: config?.androidClientId ?? "",
|
|
74
73
|
})
|
|
75
74
|
: [null, null, null];
|
|
76
75
|
|