@umituz/react-native-auth 1.6.5 → 1.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": "1.6.
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design supports Firebase Auth and can be adapted for Supabase or other providers.",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -197,14 +197,38 @@ export function useAuth(): UseAuthResult {
|
|
|
197
197
|
}, []);
|
|
198
198
|
|
|
199
199
|
const continueAsGuest = useCallback(async () => {
|
|
200
|
+
/* eslint-disable-next-line no-console */
|
|
201
|
+
if (__DEV__) {
|
|
202
|
+
console.log("[useAuth] continueAsGuest called");
|
|
203
|
+
}
|
|
200
204
|
const service = getAuthService();
|
|
201
205
|
if (!service) {
|
|
206
|
+
/* eslint-disable-next-line no-console */
|
|
207
|
+
if (__DEV__) {
|
|
208
|
+
console.log("[useAuth] No service, setting isGuest directly");
|
|
209
|
+
}
|
|
202
210
|
setIsGuest(true);
|
|
203
211
|
return;
|
|
204
212
|
}
|
|
205
213
|
try {
|
|
206
214
|
setLoading(true);
|
|
215
|
+
/* eslint-disable-next-line no-console */
|
|
216
|
+
if (__DEV__) {
|
|
217
|
+
console.log("[useAuth] Calling service.setGuestMode()");
|
|
218
|
+
}
|
|
207
219
|
await service.setGuestMode();
|
|
220
|
+
/* eslint-disable-next-line no-console */
|
|
221
|
+
if (__DEV__) {
|
|
222
|
+
console.log("[useAuth] Service.setGuestMode() completed, setting isGuest to true");
|
|
223
|
+
}
|
|
224
|
+
// State will be updated by event listener, but set it here too for immediate update
|
|
225
|
+
setIsGuest(true);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
/* eslint-disable-next-line no-console */
|
|
228
|
+
if (__DEV__) {
|
|
229
|
+
console.error("[useAuth] Error in continueAsGuest:", error);
|
|
230
|
+
}
|
|
231
|
+
// Even if service fails, set guest mode locally
|
|
208
232
|
setIsGuest(true);
|
|
209
233
|
} finally {
|
|
210
234
|
setLoading(false);
|