@blackcode_sa/metaestetics-api 1.14.13 → 1.14.14
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/dist/index.js +14 -2
- package/dist/index.mjs +14 -2
- package/package.json +1 -1
- package/src/services/auth/auth.service.ts +24 -1
package/dist/index.js
CHANGED
|
@@ -15996,7 +15996,7 @@ var AuthService = class extends BaseService {
|
|
|
15996
15996
|
* @returns Object containing user and claimed practitioner
|
|
15997
15997
|
*/
|
|
15998
15998
|
async claimDraftProfilesWithGoogle(idToken, practitionerIds) {
|
|
15999
|
-
var _a, _b, _c, _d;
|
|
15999
|
+
var _a, _b, _c, _d, _e;
|
|
16000
16000
|
try {
|
|
16001
16001
|
console.log("[AUTH] Starting claim draft profiles with Google", {
|
|
16002
16002
|
practitionerIdsCount: practitionerIds.length,
|
|
@@ -16023,8 +16023,20 @@ var AuthService = class extends BaseService {
|
|
|
16023
16023
|
}
|
|
16024
16024
|
if (!user) {
|
|
16025
16025
|
console.log("[AUTH] Creating user document DIRECTLY for:", firebaseUser.uid);
|
|
16026
|
-
console.log("[AUTH]
|
|
16026
|
+
console.log("[AUTH] Checking auth.currentUser BEFORE refresh:", ((_d = this.auth.currentUser) == null ? void 0 : _d.uid) || "NULL");
|
|
16027
|
+
try {
|
|
16028
|
+
const token = await firebaseUser.getIdToken(true);
|
|
16029
|
+
console.log("[AUTH] Got ID token, length:", (token == null ? void 0 : token.length) || 0);
|
|
16030
|
+
} catch (tokenError) {
|
|
16031
|
+
console.error("[AUTH] Error getting token:", tokenError);
|
|
16032
|
+
}
|
|
16033
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
16034
|
+
console.log("[AUTH] Using THIS.auth.currentUser AFTER refresh:", ((_e = this.auth.currentUser) == null ? void 0 : _e.uid) || "NULL");
|
|
16027
16035
|
console.log("[AUTH] Using THIS.db:", this.db ? "EXISTS" : "NULL");
|
|
16036
|
+
if (!this.auth.currentUser) {
|
|
16037
|
+
console.error("[AUTH] \u26A0\uFE0F auth.currentUser is STILL NULL after refresh! This is a React Native Firebase JS SDK issue.");
|
|
16038
|
+
console.error("[AUTH] Firestore will deny permission because request.auth will be null.");
|
|
16039
|
+
}
|
|
16028
16040
|
const userData = {
|
|
16029
16041
|
uid: firebaseUser.uid,
|
|
16030
16042
|
email: firebaseUser.email,
|
package/dist/index.mjs
CHANGED
|
@@ -16087,7 +16087,7 @@ var AuthService = class extends BaseService {
|
|
|
16087
16087
|
* @returns Object containing user and claimed practitioner
|
|
16088
16088
|
*/
|
|
16089
16089
|
async claimDraftProfilesWithGoogle(idToken, practitionerIds) {
|
|
16090
|
-
var _a, _b, _c, _d;
|
|
16090
|
+
var _a, _b, _c, _d, _e;
|
|
16091
16091
|
try {
|
|
16092
16092
|
console.log("[AUTH] Starting claim draft profiles with Google", {
|
|
16093
16093
|
practitionerIdsCount: practitionerIds.length,
|
|
@@ -16114,8 +16114,20 @@ var AuthService = class extends BaseService {
|
|
|
16114
16114
|
}
|
|
16115
16115
|
if (!user) {
|
|
16116
16116
|
console.log("[AUTH] Creating user document DIRECTLY for:", firebaseUser.uid);
|
|
16117
|
-
console.log("[AUTH]
|
|
16117
|
+
console.log("[AUTH] Checking auth.currentUser BEFORE refresh:", ((_d = this.auth.currentUser) == null ? void 0 : _d.uid) || "NULL");
|
|
16118
|
+
try {
|
|
16119
|
+
const token = await firebaseUser.getIdToken(true);
|
|
16120
|
+
console.log("[AUTH] Got ID token, length:", (token == null ? void 0 : token.length) || 0);
|
|
16121
|
+
} catch (tokenError) {
|
|
16122
|
+
console.error("[AUTH] Error getting token:", tokenError);
|
|
16123
|
+
}
|
|
16124
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
16125
|
+
console.log("[AUTH] Using THIS.auth.currentUser AFTER refresh:", ((_e = this.auth.currentUser) == null ? void 0 : _e.uid) || "NULL");
|
|
16118
16126
|
console.log("[AUTH] Using THIS.db:", this.db ? "EXISTS" : "NULL");
|
|
16127
|
+
if (!this.auth.currentUser) {
|
|
16128
|
+
console.error("[AUTH] \u26A0\uFE0F auth.currentUser is STILL NULL after refresh! This is a React Native Firebase JS SDK issue.");
|
|
16129
|
+
console.error("[AUTH] Firestore will deny permission because request.auth will be null.");
|
|
16130
|
+
}
|
|
16119
16131
|
const userData = {
|
|
16120
16132
|
uid: firebaseUser.uid,
|
|
16121
16133
|
email: firebaseUser.email,
|
package/package.json
CHANGED
|
@@ -914,9 +914,32 @@ export class AuthService extends BaseService {
|
|
|
914
914
|
// Step 2: Create User document directly (bypassing UserService to test auth instance issue)
|
|
915
915
|
if (!user) {
|
|
916
916
|
console.log('[AUTH] Creating user document DIRECTLY for:', firebaseUser.uid);
|
|
917
|
-
|
|
917
|
+
|
|
918
|
+
// CRITICAL: Force auth state refresh right before setDoc
|
|
919
|
+
// React Native Firebase JS SDK has issues where auth.currentUser becomes NULL
|
|
920
|
+
// We need to ensure it's set before Firestore operations
|
|
921
|
+
console.log('[AUTH] Checking auth.currentUser BEFORE refresh:', this.auth.currentUser?.uid || 'NULL');
|
|
922
|
+
|
|
923
|
+
// Force token refresh to ensure auth state is set
|
|
924
|
+
try {
|
|
925
|
+
const token = await firebaseUser.getIdToken(true);
|
|
926
|
+
console.log('[AUTH] Got ID token, length:', token?.length || 0);
|
|
927
|
+
} catch (tokenError) {
|
|
928
|
+
console.error('[AUTH] Error getting token:', tokenError);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
// Wait a tiny bit for auth state to propagate
|
|
932
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
933
|
+
|
|
934
|
+
console.log('[AUTH] Using THIS.auth.currentUser AFTER refresh:', this.auth.currentUser?.uid || 'NULL');
|
|
918
935
|
console.log('[AUTH] Using THIS.db:', this.db ? 'EXISTS' : 'NULL');
|
|
919
936
|
|
|
937
|
+
// If still NULL, this is a React Native Firebase JS SDK bug
|
|
938
|
+
if (!this.auth.currentUser) {
|
|
939
|
+
console.error('[AUTH] ⚠️ auth.currentUser is STILL NULL after refresh! This is a React Native Firebase JS SDK issue.');
|
|
940
|
+
console.error('[AUTH] Firestore will deny permission because request.auth will be null.');
|
|
941
|
+
}
|
|
942
|
+
|
|
920
943
|
const userData = {
|
|
921
944
|
uid: firebaseUser.uid,
|
|
922
945
|
email: firebaseUser.email,
|