@umituz/react-native-auth 2.6.5 → 2.6.6

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": "2.6.5",
3
+ "version": "2.6.6",
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",
@@ -27,20 +27,20 @@ export const styles = StyleSheet.create({
27
27
  },
28
28
  header: {
29
29
  alignItems: "center",
30
- marginBottom: 16, // Reduced from 24
31
- marginTop: 8,
32
- paddingTop: 8, // Reduced from 16
30
+ marginBottom: 8,
31
+ marginTop: 4,
32
+ paddingTop: 4,
33
33
  },
34
34
  title: {
35
- fontSize: 24, // Reduced from 28
35
+ fontSize: 22,
36
36
  fontWeight: "700",
37
- marginBottom: 4, // Reduced from 8
37
+ marginBottom: 2,
38
38
  textAlign: "center",
39
39
  },
40
40
  subtitle: {
41
- fontSize: 14, // Reduced from 15
41
+ fontSize: 13,
42
42
  textAlign: "center",
43
- lineHeight: 20, // Reduced from 22
43
+ lineHeight: 18,
44
44
  },
45
45
  formContainer: {
46
46
  flex: 1,
@@ -111,7 +111,7 @@ export const AuthLegalLinks: React.FC<AuthLegalLinksProps> = ({
111
111
 
112
112
  const styles = StyleSheet.create({
113
113
  container: {
114
- marginTop: 16,
114
+ marginTop: 8,
115
115
  alignItems: "center",
116
116
  },
117
117
  prefixText: {
@@ -50,8 +50,8 @@ const styles = StyleSheet.create({
50
50
  flexDirection: "row",
51
51
  justifyContent: "center",
52
52
  alignItems: "center",
53
- marginTop: 8,
54
- paddingTop: 8,
53
+ marginTop: 0,
54
+ paddingTop: 0,
55
55
  },
56
56
  text: {
57
57
  fontSize: 15,
@@ -153,11 +153,11 @@ export const RegisterForm: React.FC<RegisterFormProps> = ({
153
153
 
154
154
  const styles = StyleSheet.create({
155
155
  inputContainer: {
156
- marginBottom: 16,
156
+ marginBottom: 10,
157
157
  },
158
158
  buttonContainer: {
159
- marginBottom: 12,
160
- marginTop: 8,
159
+ marginBottom: 8,
160
+ marginTop: 4,
161
161
  },
162
162
  signUpButton: {
163
163
  minHeight: 48,
@@ -111,12 +111,12 @@ export const SocialLoginButtons: React.FC<SocialLoginButtonsProps> = ({
111
111
 
112
112
  const styles = StyleSheet.create({
113
113
  container: {
114
- marginTop: 16,
114
+ marginTop: 12,
115
115
  },
116
116
  dividerContainer: {
117
117
  flexDirection: "row",
118
118
  alignItems: "center",
119
- marginBottom: 16,
119
+ marginBottom: 12,
120
120
  },
121
121
  divider: {
122
122
  flex: 1,
@@ -135,7 +135,7 @@ const styles = StyleSheet.create({
135
135
  flexDirection: "row",
136
136
  alignItems: "center",
137
137
  justifyContent: "center",
138
- paddingVertical: 12,
138
+ paddingVertical: 10,
139
139
  borderRadius: 12,
140
140
  borderWidth: 1,
141
141
  gap: 8,
@@ -5,37 +5,40 @@
5
5
 
6
6
  import { useCallback } from "react";
7
7
  import { useAuth } from "./useAuth";
8
+ import { deleteCurrentUser } from "@umituz/react-native-firebase-auth";
8
9
 
9
10
  export interface UseAccountManagementReturn {
10
- logout: () => Promise<void>;
11
- deleteAccount: () => Promise<void>;
12
- isLoading: boolean;
11
+ logout: () => Promise<void>;
12
+ deleteAccount: () => Promise<void>;
13
+ isLoading: boolean;
13
14
  }
14
15
 
15
16
  export const useAccountManagement = (): UseAccountManagementReturn => {
16
- const { user, loading, signOut } = useAuth();
17
-
18
- const logout = useCallback(async () => {
19
- await signOut();
20
- }, [signOut]);
21
-
22
- const deleteAccount = useCallback(async () => {
23
- if (!user) {
24
- throw new Error("No user logged in");
25
- }
26
-
27
- if (user.isAnonymous) {
28
- throw new Error("Cannot delete anonymous account");
29
- }
30
-
31
- // Note: Add user deletion logic via Firebase Admin SDK on backend
32
- // Frontend should call backend API to delete user account
33
- throw new Error("Account deletion requires backend implementation");
34
- }, [user]);
35
-
36
- return {
37
- logout,
38
- deleteAccount,
39
- isLoading: loading,
40
- };
17
+ const { user, loading, signOut } = useAuth();
18
+
19
+ const logout = useCallback(async () => {
20
+ await signOut();
21
+ }, [signOut]);
22
+
23
+ const deleteAccount = useCallback(async () => {
24
+ if (!user) {
25
+ throw new Error("No user logged in");
26
+ }
27
+
28
+ if (user.isAnonymous) {
29
+ throw new Error("Cannot delete anonymous account");
30
+ }
31
+
32
+ const result = await deleteCurrentUser();
33
+
34
+ if (!result.success && result.error) {
35
+ throw new Error(result.error.message);
36
+ }
37
+ }, [user]);
38
+
39
+ return {
40
+ logout,
41
+ deleteAccount,
42
+ isLoading: loading,
43
+ };
41
44
  };