@umituz/react-native-auth 3.1.3 → 3.1.5
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": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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",
|
|
@@ -45,25 +45,62 @@ export const useAccountManagement = (
|
|
|
45
45
|
throw new Error("Cannot delete anonymous account");
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
if (__DEV__) {
|
|
49
|
+
console.log("[useAccountManagement] Starting delete account", {
|
|
50
|
+
userId: user.uid,
|
|
51
|
+
provider: user.provider,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
setIsDeletingAccount(true);
|
|
49
56
|
|
|
50
57
|
try {
|
|
58
|
+
if (__DEV__) {
|
|
59
|
+
console.log("[useAccountManagement] Calling deleteCurrentUser with autoReauthenticate: true");
|
|
60
|
+
}
|
|
61
|
+
|
|
51
62
|
const result = await deleteCurrentUser({ autoReauthenticate: true });
|
|
52
63
|
|
|
64
|
+
if (__DEV__) {
|
|
65
|
+
console.log("[useAccountManagement] First delete attempt result:", result);
|
|
66
|
+
}
|
|
67
|
+
|
|
53
68
|
if (result.success) {
|
|
69
|
+
if (__DEV__) {
|
|
70
|
+
console.log("[useAccountManagement] ✅ Delete successful on first attempt");
|
|
71
|
+
}
|
|
54
72
|
return;
|
|
55
73
|
}
|
|
56
74
|
|
|
57
75
|
// If reauthentication required and callback provided
|
|
58
76
|
if (result.error?.requiresReauth && onReauthRequired) {
|
|
77
|
+
if (__DEV__) {
|
|
78
|
+
console.log("[useAccountManagement] Reauth required, calling onReauthRequired callback");
|
|
79
|
+
}
|
|
80
|
+
|
|
59
81
|
const reauthSuccess = await onReauthRequired();
|
|
60
82
|
|
|
83
|
+
if (__DEV__) {
|
|
84
|
+
console.log("[useAccountManagement] onReauthRequired result:", reauthSuccess);
|
|
85
|
+
}
|
|
86
|
+
|
|
61
87
|
if (reauthSuccess) {
|
|
88
|
+
if (__DEV__) {
|
|
89
|
+
console.log("[useAccountManagement] Retrying delete after reauth");
|
|
90
|
+
}
|
|
91
|
+
|
|
62
92
|
const retryResult = await deleteCurrentUser({
|
|
63
93
|
autoReauthenticate: false,
|
|
64
94
|
});
|
|
65
95
|
|
|
96
|
+
if (__DEV__) {
|
|
97
|
+
console.log("[useAccountManagement] Retry delete result:", retryResult);
|
|
98
|
+
}
|
|
99
|
+
|
|
66
100
|
if (retryResult.success) {
|
|
101
|
+
if (__DEV__) {
|
|
102
|
+
console.log("[useAccountManagement] ✅ Delete successful after reauth");
|
|
103
|
+
}
|
|
67
104
|
return;
|
|
68
105
|
}
|
|
69
106
|
|
|
@@ -74,6 +111,9 @@ export const useAccountManagement = (
|
|
|
74
111
|
}
|
|
75
112
|
|
|
76
113
|
if (result.error) {
|
|
114
|
+
if (__DEV__) {
|
|
115
|
+
console.log("[useAccountManagement] ❌ Delete failed:", result.error);
|
|
116
|
+
}
|
|
77
117
|
throw new Error(result.error.message);
|
|
78
118
|
}
|
|
79
119
|
} finally {
|
|
@@ -40,6 +40,7 @@ export const AccountScreen: React.FC<AccountScreenProps> = ({ config }) => {
|
|
|
40
40
|
<ProfileSection
|
|
41
41
|
profile={config.profile}
|
|
42
42
|
onSignIn={config.profile.isAnonymous ? handleLogout : undefined}
|
|
43
|
+
signInText="Sign In"
|
|
43
44
|
/>
|
|
44
45
|
|
|
45
46
|
{!config.isAnonymous && config.accountActions && (
|