@umituz/react-native-auth 4.2.8 → 4.2.9
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.2.
|
|
3
|
+
"version": "4.2.9",
|
|
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/index.ts
CHANGED
|
@@ -62,7 +62,7 @@ export type { UseAppleAuthResult } from './presentation/hooks/useAppleAuth';
|
|
|
62
62
|
export { useAuthBottomSheet } from './presentation/hooks/useAuthBottomSheet';
|
|
63
63
|
export type { SocialAuthConfiguration } from './presentation/hooks/useAuthBottomSheet';
|
|
64
64
|
export { useAuthHandlers } from './presentation/hooks/useAuthHandlers';
|
|
65
|
-
export type { AuthHandlersAppInfo, AuthHandlersTranslations
|
|
65
|
+
export type { AuthHandlersAppInfo, AuthHandlersTranslations } from './presentation/hooks/useAuthHandlers';
|
|
66
66
|
export { usePasswordPromptNavigation } from './presentation/hooks/usePasswordPromptNavigation';
|
|
67
67
|
export type { UsePasswordPromptNavigationOptions, UsePasswordPromptNavigationReturn } from './presentation/hooks/usePasswordPromptNavigation';
|
|
68
68
|
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auth Handlers Hook
|
|
3
|
-
* Centralized authentication-related handlers
|
|
4
|
-
* Uses auth package for all auth operations - no duplication
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import { useCallback } from "react";
|
|
8
2
|
import { Linking, Alert } from "react-native";
|
|
9
3
|
import { useAuth } from "./useAuth";
|
|
@@ -31,15 +25,7 @@ export interface AuthHandlersTranslations {
|
|
|
31
25
|
deleteAccountError?: string;
|
|
32
26
|
}
|
|
33
27
|
|
|
34
|
-
export
|
|
35
|
-
onBeforeDeleteAccount?: () => void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const useAuthHandlers = (
|
|
39
|
-
appInfo: AuthHandlersAppInfo,
|
|
40
|
-
translations?: AuthHandlersTranslations,
|
|
41
|
-
options?: AuthHandlersOptions,
|
|
42
|
-
) => {
|
|
28
|
+
export const useAuthHandlers = (appInfo: AuthHandlersAppInfo, translations?: AuthHandlersTranslations) => {
|
|
43
29
|
const { signOut } = useAuth();
|
|
44
30
|
const { showAuthModal } = useAuthModalStore();
|
|
45
31
|
|
|
@@ -98,10 +84,6 @@ export const useAuthHandlers = (
|
|
|
98
84
|
console.log("[useAuthHandlers] handleDeleteAccount called");
|
|
99
85
|
}
|
|
100
86
|
try {
|
|
101
|
-
if (options?.onBeforeDeleteAccount) {
|
|
102
|
-
options.onBeforeDeleteAccount();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
87
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
106
88
|
console.log("[useAuthHandlers] Calling deleteAccountFromAuth...");
|
|
107
89
|
}
|
|
@@ -119,7 +101,7 @@ export const useAuthHandlers = (
|
|
|
119
101
|
errorMessage || translations?.deleteAccountError || "Failed to delete account"
|
|
120
102
|
);
|
|
121
103
|
}
|
|
122
|
-
}, [deleteAccountFromAuth, translations
|
|
104
|
+
}, [deleteAccountFromAuth, translations]);
|
|
123
105
|
|
|
124
106
|
const handleSignIn = useCallback(() => {
|
|
125
107
|
showAuthModal(undefined, "login");
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
+
import { CommonActions } from '@react-navigation/native';
|
|
2
3
|
import { AppNavigation } from '@umituz/react-native-design-system';
|
|
3
4
|
import { setPasswordPromptCallback } from '../utils/passwordPromptCallback';
|
|
4
5
|
|
|
@@ -29,14 +30,23 @@ export const usePasswordPromptNavigation = (
|
|
|
29
30
|
setPasswordPromptCallback(resolve);
|
|
30
31
|
|
|
31
32
|
try {
|
|
32
|
-
AppNavigation.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const ref = AppNavigation.getRef();
|
|
34
|
+
if (!ref?.isReady()) {
|
|
35
|
+
throw new Error("Navigation not ready");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ref.dispatch(
|
|
39
|
+
CommonActions.reset({
|
|
40
|
+
index: 1,
|
|
41
|
+
routes: [
|
|
42
|
+
{ name: 'Home' },
|
|
43
|
+
{ name: 'PasswordPrompt', params: { title, message, confirmText, cancelText } },
|
|
44
|
+
],
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
|
|
38
48
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
39
|
-
console.log("[showPasswordPrompt] Navigation
|
|
49
|
+
console.log("[showPasswordPrompt] Navigation reset to PasswordPrompt");
|
|
40
50
|
}
|
|
41
51
|
} catch (error) {
|
|
42
52
|
if (typeof __DEV__ !== "undefined" && __DEV__) {
|