@umituz/react-native-auth 4.2.2 → 4.2.3
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.3",
|
|
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",
|
|
@@ -7,6 +7,8 @@ import { useCallback, useState } from "react";
|
|
|
7
7
|
import { useAuth } from "./useAuth";
|
|
8
8
|
import { deleteCurrentUser } from "@umituz/react-native-firebase";
|
|
9
9
|
|
|
10
|
+
declare const __DEV__: boolean;
|
|
11
|
+
|
|
10
12
|
export interface UseAccountManagementOptions {
|
|
11
13
|
/**
|
|
12
14
|
* Callback invoked when reauthentication is required (for Google/Apple)
|
|
@@ -40,6 +42,10 @@ export const useAccountManagement = (
|
|
|
40
42
|
}, [signOut]);
|
|
41
43
|
|
|
42
44
|
const deleteAccount = useCallback(async () => {
|
|
45
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
46
|
+
console.log("[useAccountManagement] deleteAccount called, user:", user);
|
|
47
|
+
}
|
|
48
|
+
|
|
43
49
|
if (!user) {
|
|
44
50
|
throw new Error("No user logged in");
|
|
45
51
|
}
|
|
@@ -51,12 +57,24 @@ export const useAccountManagement = (
|
|
|
51
57
|
setIsDeletingAccount(true);
|
|
52
58
|
|
|
53
59
|
try {
|
|
60
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
61
|
+
console.log("[useAccountManagement] Calling deleteCurrentUser with options:", {
|
|
62
|
+
autoReauthenticate: true,
|
|
63
|
+
hasOnPasswordRequired: !!onPasswordRequired,
|
|
64
|
+
hasOnReauthRequired: !!onReauthRequired,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
54
68
|
const result = await deleteCurrentUser({
|
|
55
69
|
autoReauthenticate: true,
|
|
56
70
|
onPasswordRequired,
|
|
57
71
|
onGoogleReauthRequired: onReauthRequired,
|
|
58
72
|
});
|
|
59
73
|
|
|
74
|
+
if (typeof __DEV__ !== "undefined" && __DEV__) {
|
|
75
|
+
console.log("[useAccountManagement] deleteCurrentUser result:", result);
|
|
76
|
+
}
|
|
77
|
+
|
|
60
78
|
if (!result.success) {
|
|
61
79
|
throw new Error(result.error?.message || "Failed to delete account");
|
|
62
80
|
}
|