@umituz/react-native-auth 3.4.8 → 3.4.10

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.4.8",
3
+ "version": "3.4.10",
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",
package/src/index.ts CHANGED
@@ -87,6 +87,13 @@ export {
87
87
  resetAuthService,
88
88
  } from './infrastructure/services/AuthService';
89
89
 
90
+ export {
91
+ createStorageProvider,
92
+ StorageProviderAdapter,
93
+ } from './infrastructure/adapters/StorageProviderAdapter';
94
+
95
+ export type { IStorageProvider } from './infrastructure/services/AuthPackage';
96
+
90
97
  export {
91
98
  ensureUserDocument,
92
99
  markUserDeleted,
@@ -169,6 +169,10 @@ export async function ensureUserDocument(
169
169
  extras?: UserDocumentExtras,
170
170
  ): Promise<boolean> {
171
171
  const db = getFirestore();
172
+ if (typeof __DEV__ !== "undefined" && __DEV__) {
173
+ // eslint-disable-next-line no-console
174
+ console.log("[UserDocumentService] db:", db, "type:", typeof db, "constructor:", db?.constructor?.name);
175
+ }
172
176
  if (!db || !user.uid) return false;
173
177
 
174
178
  try {
@@ -11,6 +11,7 @@ import { useAppDesignTokens, AtomicIcon, AtomicText } from "@umituz/react-native
11
11
  export interface AccountActionsConfig {
12
12
  logoutText: string;
13
13
  deleteAccountText: string;
14
+ changePasswordText?: string;
14
15
  logoutConfirmTitle: string;
15
16
  logoutConfirmMessage: string;
16
17
  deleteConfirmTitle: string;
@@ -19,6 +20,8 @@ export interface AccountActionsConfig {
19
20
  deleteErrorMessage?: string;
20
21
  onLogout: () => Promise<void>;
21
22
  onDeleteAccount: () => Promise<void>;
23
+ onChangePassword?: () => void;
24
+ showChangePassword?: boolean;
22
25
  }
23
26
 
24
27
  export interface AccountActionsProps {
@@ -30,6 +33,7 @@ export const AccountActions: React.FC<AccountActionsProps> = ({ config }) => {
30
33
  const {
31
34
  logoutText,
32
35
  deleteAccountText,
36
+ changePasswordText,
33
37
  logoutConfirmTitle,
34
38
  logoutConfirmMessage,
35
39
  deleteConfirmTitle,
@@ -38,6 +42,8 @@ export const AccountActions: React.FC<AccountActionsProps> = ({ config }) => {
38
42
  deleteErrorMessage = "Failed to delete account. Please try again.",
39
43
  onLogout,
40
44
  onDeleteAccount,
45
+ onChangePassword,
46
+ showChangePassword = false,
41
47
  } = config;
42
48
 
43
49
  const handleLogout = () => {
@@ -80,6 +86,21 @@ export const AccountActions: React.FC<AccountActionsProps> = ({ config }) => {
80
86
 
81
87
  return (
82
88
  <View style={styles.container}>
89
+ {/* Change Password */}
90
+ {showChangePassword && onChangePassword && changePasswordText && (
91
+ <TouchableOpacity
92
+ style={[styles.actionButton, { borderColor: tokens.colors.border }]}
93
+ onPress={onChangePassword}
94
+ activeOpacity={0.7}
95
+ >
96
+ <AtomicIcon name="key-outline" size="md" customColor={tokens.colors.textPrimary} />
97
+ <AtomicText style={[styles.actionText, { color: tokens.colors.textPrimary }]}>
98
+ {changePasswordText}
99
+ </AtomicText>
100
+ <AtomicIcon name="chevron-forward" size="sm" color="secondary" />
101
+ </TouchableOpacity>
102
+ )}
103
+
83
104
  {/* Logout */}
84
105
  <TouchableOpacity
85
106
  style={[styles.actionButton, { borderColor: tokens.colors.border }]}
@@ -4,9 +4,8 @@ import {
4
4
  TouchableOpacity,
5
5
  StyleSheet,
6
6
  Platform,
7
- ActivityIndicator,
8
7
  } from "react-native";
9
- import { useAppDesignTokens, AtomicText, AtomicIcon } from "@umituz/react-native-design-system";
8
+ import { useAppDesignTokens, AtomicText, AtomicIcon, AtomicSpinner } from "@umituz/react-native-design-system";
10
9
  import { useLocalization } from "@umituz/react-native-localization";
11
10
  import type { SocialAuthProvider } from "../../domain/value-objects/AuthConfig";
12
11
 
@@ -67,7 +66,7 @@ export const SocialLoginButtons: React.FC<SocialLoginButtonsProps> = ({
67
66
  activeOpacity={0.7}
68
67
  >
69
68
  {googleLoading ? (
70
- <ActivityIndicator size="small" color={tokens.colors.textPrimary} />
69
+ <AtomicSpinner size="sm" color={tokens.colors.textPrimary} />
71
70
  ) : (
72
71
  <>
73
72
  <AtomicIcon name="logo-google" size="sm" />
@@ -91,7 +90,7 @@ export const SocialLoginButtons: React.FC<SocialLoginButtonsProps> = ({
91
90
  activeOpacity={0.7}
92
91
  >
93
92
  {appleLoading ? (
94
- <ActivityIndicator size="small" color={tokens.colors.textPrimary} />
93
+ <AtomicSpinner size="sm" color={tokens.colors.textPrimary} />
95
94
  ) : (
96
95
  <>
97
96
  <AtomicIcon name="logo-apple" size="sm" color="onSurface" />
@@ -5,8 +5,8 @@
5
5
  */
6
6
 
7
7
  import React from "react";
8
- import { View, StyleSheet } from "react-native";
9
- import { useAppDesignTokens, ScreenLayout } from "@umituz/react-native-design-system";
8
+ import { View, TouchableOpacity, StyleSheet } from "react-native";
9
+ import { useAppDesignTokens, ScreenLayout, AtomicIcon, AtomicText } from "@umituz/react-native-design-system";
10
10
 
11
11
  import { ProfileSection, type ProfileSectionConfig } from "../components/ProfileSection";
12
12
  import { AccountActions, type AccountActionsConfig } from "../components/AccountActions";
@@ -15,6 +15,8 @@ export interface AccountScreenConfig {
15
15
  profile: ProfileSectionConfig;
16
16
  accountActions?: AccountActionsConfig;
17
17
  isAnonymous: boolean;
18
+ editProfileText?: string;
19
+ onEditProfile?: () => void;
18
20
  }
19
21
 
20
22
  export interface AccountScreenProps {
@@ -43,6 +45,24 @@ export const AccountScreen: React.FC<AccountScreenProps> = ({ config }) => {
43
45
  signInText="Sign In"
44
46
  />
45
47
 
48
+ {/* Edit Profile Option */}
49
+ {!config.isAnonymous && config.onEditProfile && config.editProfileText && (
50
+ <>
51
+ <View style={styles.divider} />
52
+ <TouchableOpacity
53
+ style={[styles.actionButton, { borderColor: tokens.colors.border }]}
54
+ onPress={config.onEditProfile}
55
+ activeOpacity={0.7}
56
+ >
57
+ <AtomicIcon name="person-outline" size="md" customColor={tokens.colors.textPrimary} />
58
+ <AtomicText style={[styles.actionText, { color: tokens.colors.textPrimary }]}>
59
+ {config.editProfileText}
60
+ </AtomicText>
61
+ <AtomicIcon name="chevron-forward" size="sm" color="secondary" />
62
+ </TouchableOpacity>
63
+ </>
64
+ )}
65
+
46
66
  {!config.isAnonymous && config.accountActions && (
47
67
  <>
48
68
  <View style={styles.divider} />
@@ -60,5 +80,19 @@ const styles = StyleSheet.create({
60
80
  divider: {
61
81
  height: 24,
62
82
  },
83
+ actionButton: {
84
+ flexDirection: "row",
85
+ alignItems: "center",
86
+ paddingVertical: 16,
87
+ paddingHorizontal: 16,
88
+ borderRadius: 12,
89
+ borderWidth: 1,
90
+ gap: 12,
91
+ },
92
+ actionText: {
93
+ flex: 1,
94
+ fontSize: 16,
95
+ fontWeight: "500",
96
+ },
63
97
  });
64
98
 
@@ -4,8 +4,8 @@
4
4
  */
5
5
 
6
6
  import React from "react";
7
- import { View, ScrollView, StyleSheet, ActivityIndicator } from "react-native";
8
- import { useAppDesignTokens, AtomicText } from "@umituz/react-native-design-system";
7
+ import { View, ScrollView, StyleSheet } from "react-native";
8
+ import { useAppDesignTokens, AtomicText, AtomicSpinner } from "@umituz/react-native-design-system";
9
9
  import { EditProfileAvatar } from "../components/EditProfileAvatar";
10
10
  import { EditProfileForm } from "../components/EditProfileForm";
11
11
  import { EditProfileActions } from "../components/EditProfileActions";
@@ -46,7 +46,7 @@ export const EditProfileScreen: React.FC<EditProfileScreenProps> = ({ config })
46
46
  if (config.isLoading) {
47
47
  return (
48
48
  <View style={[styles.loading, { backgroundColor: tokens.colors.backgroundPrimary }]}>
49
- <ActivityIndicator size="large" color={tokens.colors.primary} />
49
+ <AtomicSpinner size="lg" color="primary" fullContainer />
50
50
  </View>
51
51
  );
52
52
  }