@umituz/react-native-auth 4.3.79 → 4.3.80
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.
|
|
3
|
+
"version": "4.3.80",
|
|
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",
|
package/src/exports/shared.ts
CHANGED
|
@@ -7,6 +7,8 @@ import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
|
7
7
|
import type { BottomSheetModalRef } from '@umituz/react-native-design-system/molecules';
|
|
8
8
|
import { useAuthModalStore } from '../../stores/authModalStore';
|
|
9
9
|
import { useAuth } from '../useAuth';
|
|
10
|
+
import { useAppleAuth } from '../useAppleAuth';
|
|
11
|
+
import { useGoogleAuth } from '../useGoogleAuth';
|
|
10
12
|
import { determineEnabledProviders } from '../../utils/socialAuthHandler.util';
|
|
11
13
|
import { useAuthTransitions, executeAfterAuth } from '../../utils/authTransition.util';
|
|
12
14
|
import { useSocialAuthHandlers } from './useSocialAuthHandlers';
|
|
@@ -22,6 +24,10 @@ export function useAuthBottomSheet(params: UseAuthBottomSheetParams = {}) {
|
|
|
22
24
|
useAuthModalStore();
|
|
23
25
|
const { isAuthenticated, isAnonymous } = useAuth();
|
|
24
26
|
|
|
27
|
+
// Social auth availability
|
|
28
|
+
const { appleAvailable } = useAppleAuth();
|
|
29
|
+
const { googleConfigured } = useGoogleAuth();
|
|
30
|
+
|
|
25
31
|
// Social auth handlers
|
|
26
32
|
const { handleGoogleSignIn, handleAppleSignIn, googleLoading, appleLoading } =
|
|
27
33
|
useSocialAuthHandlers(socialConfig, onGoogleSignIn, onAppleSignIn);
|
|
@@ -59,11 +65,9 @@ export function useAuthBottomSheet(params: UseAuthBottomSheetParams = {}) {
|
|
|
59
65
|
hideAuthModal();
|
|
60
66
|
onAuthSuccess?.();
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
return executeAfterAuth(() => {
|
|
63
69
|
executePendingCallback();
|
|
64
70
|
});
|
|
65
|
-
|
|
66
|
-
return () => clearTimeout(timeoutId);
|
|
67
71
|
}
|
|
68
72
|
return undefined;
|
|
69
73
|
}
|
|
@@ -106,5 +110,3 @@ export function useAuthBottomSheet(params: UseAuthBottomSheetParams = {}) {
|
|
|
106
110
|
]
|
|
107
111
|
);
|
|
108
112
|
}
|
|
109
|
-
|
|
110
|
-
// TODO: Fix appleAvailable and googleConfigured references
|
|
@@ -66,10 +66,12 @@ export function useAuthTransitions(
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Execute callback with delay after auth
|
|
69
|
+
* @returns Cleanup function to cancel the timeout
|
|
69
70
|
*/
|
|
70
71
|
export function executeAfterAuth(
|
|
71
72
|
callback: () => void,
|
|
72
73
|
delay: number = 100
|
|
73
|
-
):
|
|
74
|
-
|
|
74
|
+
): () => void {
|
|
75
|
+
const timeoutId = setTimeout(callback, delay);
|
|
76
|
+
return () => clearTimeout(timeoutId);
|
|
75
77
|
}
|