@umituz/react-native-auth 4.2.2 → 4.2.4

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.2",
3
+ "version": "4.2.4",
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
  }
@@ -7,6 +7,8 @@
7
7
  import { useCallback, useRef, useEffect } from 'react';
8
8
  import { AppNavigation } from '@umituz/react-native-design-system';
9
9
 
10
+ declare const __DEV__: boolean;
11
+
10
12
  export interface UsePasswordPromptNavigationOptions {
11
13
  title?: string;
12
14
  message?: string;
@@ -34,8 +36,15 @@ export const usePasswordPromptNavigation = (
34
36
  }, []);
35
37
 
36
38
  const showPasswordPrompt = useCallback((): Promise<string | null> => {
39
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
40
+ console.log("[showPasswordPrompt] Called");
41
+ }
42
+
37
43
  return new Promise<string | null>((resolve, reject) => {
38
44
  if (resolveRef.current) {
45
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
46
+ console.log("[showPasswordPrompt] Resolving previous promise with null");
47
+ }
39
48
  resolveRef.current(null);
40
49
  }
41
50
 
@@ -43,6 +52,9 @@ export const usePasswordPromptNavigation = (
43
52
 
44
53
  const params = {
45
54
  onComplete: (password: string | null) => {
55
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
56
+ console.log("[showPasswordPrompt] onComplete called with:", password ? "password" : "null");
57
+ }
46
58
  if (resolveRef.current) {
47
59
  resolveRef.current(password);
48
60
  resolveRef.current = null;
@@ -55,8 +67,18 @@ export const usePasswordPromptNavigation = (
55
67
  };
56
68
 
57
69
  try {
70
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
71
+ console.log("[showPasswordPrompt] Navigating to PasswordPrompt with params:", { title, message });
72
+ console.log("[showPasswordPrompt] AppNavigation:", AppNavigation);
73
+ }
58
74
  AppNavigation.navigate('PasswordPrompt', params);
75
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
76
+ console.log("[showPasswordPrompt] Navigation called successfully");
77
+ }
59
78
  } catch (error) {
79
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
80
+ console.error("[showPasswordPrompt] Navigation failed:", error);
81
+ }
60
82
  if (resolveRef.current) {
61
83
  resolveRef.current(null);
62
84
  resolveRef.current = null;