@umituz/react-native-firebase 1.13.77 → 1.13.79
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-firebase",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.79",
|
|
4
4
|
"description": "Unified Firebase package for React Native apps - Auth and Firestore services using Firebase JS SDK (no native modules).",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
package/src/auth/index.ts
CHANGED
|
@@ -144,3 +144,10 @@ export type {
|
|
|
144
144
|
SocialAuthResult,
|
|
145
145
|
UseSocialAuthResult,
|
|
146
146
|
} from './presentation/hooks/useSocialAuth';
|
|
147
|
+
|
|
148
|
+
// Password Management
|
|
149
|
+
export {
|
|
150
|
+
updateUserPassword,
|
|
151
|
+
} from './infrastructure/services/password.service';
|
|
152
|
+
export type { PasswordUpdateResult } from './infrastructure/services/password.service';
|
|
153
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Password Service
|
|
3
|
+
* Handles password management operations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { updatePassword, type User } from 'firebase/auth';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Result of a password update operation
|
|
10
|
+
*/
|
|
11
|
+
export interface PasswordUpdateResult {
|
|
12
|
+
success: boolean;
|
|
13
|
+
error?: {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Update the current user's password
|
|
21
|
+
* Note: Requires recent authentication. Re-authenticate before calling if needed.
|
|
22
|
+
*/
|
|
23
|
+
export async function updateUserPassword(user: User, newPassword: string): Promise<PasswordUpdateResult> {
|
|
24
|
+
try {
|
|
25
|
+
await updatePassword(user, newPassword);
|
|
26
|
+
return { success: true };
|
|
27
|
+
} catch (error: any) {
|
|
28
|
+
return {
|
|
29
|
+
success: false,
|
|
30
|
+
error: {
|
|
31
|
+
code: error.code || 'auth/password-update-failed',
|
|
32
|
+
message: error.message || 'Failed to update password',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|