@umituz/react-native-auth 3.5.2 → 3.5.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": "3.5.
|
|
3
|
+
"version": "3.5.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",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Auth Listener Initialization
|
|
3
|
-
* Sets up Firebase auth
|
|
3
|
+
* Sets up Firebase auth token listener with optional auto anonymous sign-in
|
|
4
|
+
* Uses onIdTokenChanged for profile updates (displayName, email)
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
|
-
import {
|
|
7
|
+
import { onIdTokenChanged } from "firebase/auth";
|
|
7
8
|
import {
|
|
8
9
|
getFirebaseAuth,
|
|
9
10
|
anonymousAuthService,
|
|
@@ -64,12 +65,13 @@ export function initializeAuthListener(
|
|
|
64
65
|
|
|
65
66
|
listenerInitialized = true;
|
|
66
67
|
|
|
67
|
-
const unsubscribe =
|
|
68
|
+
const unsubscribe = onIdTokenChanged(auth, (user) => {
|
|
68
69
|
if (__DEV__) {
|
|
69
|
-
console.log("[AuthListener]
|
|
70
|
+
console.log("[AuthListener] onIdTokenChanged:", {
|
|
70
71
|
uid: user?.uid ?? null,
|
|
71
72
|
isAnonymous: user?.isAnonymous ?? null,
|
|
72
73
|
email: user?.email ?? null,
|
|
74
|
+
displayName: user?.displayName ?? null,
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
77
|
|