@umituz/react-native-auth 4.2.9 → 4.2.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.2.
|
|
3
|
+
"version": "4.2.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",
|
|
@@ -3,6 +3,8 @@ import { View, TouchableOpacity, StyleSheet } from "react-native";
|
|
|
3
3
|
import { useAppDesignTokens, AtomicIcon, AtomicText, useAlert, AlertType, AlertMode } from "@umituz/react-native-design-system";
|
|
4
4
|
import { actionButtonStyle } from "../utils/commonStyles";
|
|
5
5
|
|
|
6
|
+
declare const __DEV__: boolean;
|
|
7
|
+
|
|
6
8
|
export interface AccountActionsConfig {
|
|
7
9
|
logoutText: string;
|
|
8
10
|
deleteAccountText: string;
|
|
@@ -65,17 +67,33 @@ export const AccountActions: React.FC<AccountActionsProps> = ({ config }) => {
|
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
const handleDeleteAccount = () => {
|
|
70
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
71
|
+
console.log("[AccountActions] handleDeleteAccount called, showing confirmation modal");
|
|
72
|
+
}
|
|
68
73
|
alert.show(AlertType.ERROR, AlertMode.MODAL, deleteConfirmTitle, deleteConfirmMessage, {
|
|
69
74
|
actions: [
|
|
70
|
-
{ id: "cancel", label: cancelText, style: "secondary", onPress: () => {
|
|
75
|
+
{ id: "cancel", label: cancelText, style: "secondary", onPress: () => {
|
|
76
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
77
|
+
console.log("[AccountActions] Delete account cancelled");
|
|
78
|
+
}
|
|
79
|
+
} },
|
|
71
80
|
{
|
|
72
81
|
id: "confirm",
|
|
73
82
|
label: deleteAccountText,
|
|
74
83
|
style: "destructive",
|
|
75
84
|
onPress: async () => {
|
|
85
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
86
|
+
console.log("[AccountActions] Delete account confirmed, modal should be closed now, calling onDeleteAccount");
|
|
87
|
+
}
|
|
76
88
|
try {
|
|
77
89
|
await onDeleteAccount();
|
|
78
|
-
|
|
90
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
91
|
+
console.log("[AccountActions] onDeleteAccount completed successfully");
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
95
|
+
console.error("[AccountActions] onDeleteAccount failed:", error);
|
|
96
|
+
}
|
|
79
97
|
alert.showError(deleteErrorTitle, deleteErrorMessage, { mode: AlertMode.MODAL });
|
|
80
98
|
}
|
|
81
99
|
},
|
|
@@ -10,6 +10,8 @@ import {
|
|
|
10
10
|
} from '@umituz/react-native-design-system';
|
|
11
11
|
import { resolvePasswordPrompt } from '../utils/passwordPromptCallback';
|
|
12
12
|
|
|
13
|
+
declare const __DEV__: boolean;
|
|
14
|
+
|
|
13
15
|
export interface PasswordPromptScreenProps {
|
|
14
16
|
route: {
|
|
15
17
|
params: {
|
|
@@ -32,6 +34,10 @@ export const PasswordPromptScreen: React.FC<PasswordPromptScreenProps> = ({
|
|
|
32
34
|
const [password, setPassword] = useState('');
|
|
33
35
|
const [error, setError] = useState('');
|
|
34
36
|
|
|
37
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
38
|
+
console.log("[PasswordPromptScreen] Rendered");
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
const {
|
|
36
42
|
title = 'Password Required',
|
|
37
43
|
message = 'Enter your password to continue',
|
|
@@ -40,15 +46,24 @@ export const PasswordPromptScreen: React.FC<PasswordPromptScreenProps> = ({
|
|
|
40
46
|
} = route.params;
|
|
41
47
|
|
|
42
48
|
const handleConfirm = () => {
|
|
49
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
50
|
+
console.log("[PasswordPromptScreen] handleConfirm called, password length:", password.length);
|
|
51
|
+
}
|
|
43
52
|
if (!password.trim()) {
|
|
44
53
|
setError('Password is required');
|
|
45
54
|
return;
|
|
46
55
|
}
|
|
56
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
57
|
+
console.log("[PasswordPromptScreen] Resolving password prompt and going back");
|
|
58
|
+
}
|
|
47
59
|
resolvePasswordPrompt(password);
|
|
48
60
|
navigation.goBack();
|
|
49
61
|
};
|
|
50
62
|
|
|
51
63
|
const handleCancel = () => {
|
|
64
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
65
|
+
console.log("[PasswordPromptScreen] handleCancel called");
|
|
66
|
+
}
|
|
52
67
|
resolvePasswordPrompt(null);
|
|
53
68
|
navigation.goBack();
|
|
54
69
|
};
|
|
@@ -29,6 +29,16 @@ export function getAuthErrorLocalizationKey(error: unknown): string {
|
|
|
29
29
|
AUTH_USER_DISABLED: "auth.errors.userDisabled",
|
|
30
30
|
AUTH_NOT_INITIALIZED: "auth.errors.authNotInitialized",
|
|
31
31
|
AUTH_INVALID_CREDENTIAL: "auth.errors.invalidCredential",
|
|
32
|
+
"auth/invalid-email": "auth.errors.invalidEmail",
|
|
33
|
+
"auth/weak-password": "auth.errors.weakPassword",
|
|
34
|
+
"auth/user-not-found": "auth.errors.invalidCredential",
|
|
35
|
+
"auth/wrong-password": "auth.errors.invalidCredential",
|
|
36
|
+
"auth/email-already-in-use": "auth.errors.emailAlreadyInUse",
|
|
37
|
+
"auth/network-request-failed": "auth.errors.networkError",
|
|
38
|
+
"auth/too-many-requests": "auth.errors.tooManyRequests",
|
|
39
|
+
"auth/user-disabled": "auth.errors.userDisabled",
|
|
40
|
+
"auth/invalid-credential": "auth.errors.invalidCredential",
|
|
41
|
+
"auth/invalid-login-credentials": "auth.errors.invalidCredential",
|
|
32
42
|
};
|
|
33
43
|
|
|
34
44
|
// Check error name for specific error types
|