@umituz/react-native-auth 3.5.0 → 3.5.1

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.0",
3
+ "version": "3.5.1",
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",
@@ -106,10 +106,16 @@ export const useAuthStore = createStore<AuthState, AuthActions>({
106
106
  },
107
107
 
108
108
  setIsAnonymous: (isAnonymous) => {
109
+ const { user } = get();
109
110
  if (__DEV__) {
110
- console.log("[AuthStore] setIsAnonymous:", isAnonymous);
111
+ console.log("[AuthStore] setIsAnonymous:", { isAnonymous, hadUser: !!user });
112
+ }
113
+ // Also update user.isAnonymous when converting from anonymous
114
+ if (user && !isAnonymous && user.isAnonymous) {
115
+ set({ isAnonymous, user: { ...user, isAnonymous: false } });
116
+ } else {
117
+ set({ isAnonymous });
111
118
  }
112
- set({ isAnonymous });
113
119
  },
114
120
 
115
121
  setError: (error) => {