@blackcode_sa/metaestetics-api 1.14.7 → 1.14.8

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 CHANGED
@@ -12906,12 +12906,13 @@ var UserService = class extends BaseService {
12906
12906
  * Kreira novog korisnika na osnovu Firebase korisnika
12907
12907
  */
12908
12908
  async createUser(firebaseUser, roles = ["patient" /* PATIENT */], options) {
12909
- var _a, _b, _c, _d, _e, _f, _g, _h;
12909
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
12910
12910
  console.log("[USER_SERVICE] ====== CREATE USER DEBUG ======");
12911
+ console.log("[USER_SERVICE] Auth instance ID:", ((_a = this.auth) == null ? void 0 : _a.__debugId) || "no-id");
12911
12912
  console.log("[USER_SERVICE] Current auth state:", {
12912
- currentUser: ((_b = (_a = this.auth) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.uid) || "NULL",
12913
- currentUserEmail: ((_d = (_c = this.auth) == null ? void 0 : _c.currentUser) == null ? void 0 : _d.email) || "NULL",
12914
- currentUserProvider: ((_f = (_e = this.auth) == null ? void 0 : _e.currentUser) == null ? void 0 : _f.providerId) || "NULL"
12913
+ currentUser: ((_c = (_b = this.auth) == null ? void 0 : _b.currentUser) == null ? void 0 : _c.uid) || "NULL",
12914
+ currentUserEmail: ((_e = (_d = this.auth) == null ? void 0 : _d.currentUser) == null ? void 0 : _e.email) || "NULL",
12915
+ currentUserProvider: ((_g = (_f = this.auth) == null ? void 0 : _f.currentUser) == null ? void 0 : _g.providerId) || "NULL"
12915
12916
  });
12916
12917
  console.log("[USER_SERVICE] Firebase user passed to createUser:", {
12917
12918
  uid: (firebaseUser == null ? void 0 : firebaseUser.uid) || "NULL",
@@ -12919,7 +12920,7 @@ var UserService = class extends BaseService {
12919
12920
  providerId: (firebaseUser == null ? void 0 : firebaseUser.providerId) || "NULL",
12920
12921
  isAnonymous: firebaseUser == null ? void 0 : firebaseUser.isAnonymous
12921
12922
  });
12922
- console.log("[USER_SERVICE] Auth instances match:", ((_h = (_g = this.auth) == null ? void 0 : _g.currentUser) == null ? void 0 : _h.uid) === (firebaseUser == null ? void 0 : firebaseUser.uid));
12923
+ console.log("[USER_SERVICE] Auth instances match:", ((_i = (_h = this.auth) == null ? void 0 : _h.currentUser) == null ? void 0 : _i.uid) === (firebaseUser == null ? void 0 : firebaseUser.uid));
12923
12924
  console.log("[USER_SERVICE] Document path:", `${USERS_COLLECTION}/${firebaseUser == null ? void 0 : firebaseUser.uid}`);
12924
12925
  console.log("[USER_SERVICE] Roles:", roles);
12925
12926
  console.log("[USER_SERVICE] ================================");
@@ -16005,6 +16006,11 @@ var AuthService = class extends BaseService {
16005
16006
  await firebaseUser.getIdToken(true);
16006
16007
  console.log("[AUTH] Token refreshed successfully");
16007
16008
  console.log("[AUTH] Verifying auth.currentUser:", ((_a = this.auth.currentUser) == null ? void 0 : _a.uid) || "NULL");
16009
+ console.log("[AUTH] Auth instance ID:", this.auth.__debugId || "no-id");
16010
+ if (!this.auth.__debugId) {
16011
+ this.auth.__debugId = "auth-" + Date.now();
16012
+ }
16013
+ console.log("[AUTH] Auth instance ID set to:", this.auth.__debugId);
16008
16014
  const practitionerService = new PractitionerService(this.db, this.auth, this.app);
16009
16015
  let user = null;
16010
16016
  try {
package/dist/index.mjs CHANGED
@@ -12929,12 +12929,13 @@ var UserService = class extends BaseService {
12929
12929
  * Kreira novog korisnika na osnovu Firebase korisnika
12930
12930
  */
12931
12931
  async createUser(firebaseUser, roles = ["patient" /* PATIENT */], options) {
12932
- var _a, _b, _c, _d, _e, _f, _g, _h;
12932
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
12933
12933
  console.log("[USER_SERVICE] ====== CREATE USER DEBUG ======");
12934
+ console.log("[USER_SERVICE] Auth instance ID:", ((_a = this.auth) == null ? void 0 : _a.__debugId) || "no-id");
12934
12935
  console.log("[USER_SERVICE] Current auth state:", {
12935
- currentUser: ((_b = (_a = this.auth) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.uid) || "NULL",
12936
- currentUserEmail: ((_d = (_c = this.auth) == null ? void 0 : _c.currentUser) == null ? void 0 : _d.email) || "NULL",
12937
- currentUserProvider: ((_f = (_e = this.auth) == null ? void 0 : _e.currentUser) == null ? void 0 : _f.providerId) || "NULL"
12936
+ currentUser: ((_c = (_b = this.auth) == null ? void 0 : _b.currentUser) == null ? void 0 : _c.uid) || "NULL",
12937
+ currentUserEmail: ((_e = (_d = this.auth) == null ? void 0 : _d.currentUser) == null ? void 0 : _e.email) || "NULL",
12938
+ currentUserProvider: ((_g = (_f = this.auth) == null ? void 0 : _f.currentUser) == null ? void 0 : _g.providerId) || "NULL"
12938
12939
  });
12939
12940
  console.log("[USER_SERVICE] Firebase user passed to createUser:", {
12940
12941
  uid: (firebaseUser == null ? void 0 : firebaseUser.uid) || "NULL",
@@ -12942,7 +12943,7 @@ var UserService = class extends BaseService {
12942
12943
  providerId: (firebaseUser == null ? void 0 : firebaseUser.providerId) || "NULL",
12943
12944
  isAnonymous: firebaseUser == null ? void 0 : firebaseUser.isAnonymous
12944
12945
  });
12945
- console.log("[USER_SERVICE] Auth instances match:", ((_h = (_g = this.auth) == null ? void 0 : _g.currentUser) == null ? void 0 : _h.uid) === (firebaseUser == null ? void 0 : firebaseUser.uid));
12946
+ console.log("[USER_SERVICE] Auth instances match:", ((_i = (_h = this.auth) == null ? void 0 : _h.currentUser) == null ? void 0 : _i.uid) === (firebaseUser == null ? void 0 : firebaseUser.uid));
12946
12947
  console.log("[USER_SERVICE] Document path:", `${USERS_COLLECTION}/${firebaseUser == null ? void 0 : firebaseUser.uid}`);
12947
12948
  console.log("[USER_SERVICE] Roles:", roles);
12948
12949
  console.log("[USER_SERVICE] ================================");
@@ -16092,6 +16093,11 @@ var AuthService = class extends BaseService {
16092
16093
  await firebaseUser.getIdToken(true);
16093
16094
  console.log("[AUTH] Token refreshed successfully");
16094
16095
  console.log("[AUTH] Verifying auth.currentUser:", ((_a = this.auth.currentUser) == null ? void 0 : _a.uid) || "NULL");
16096
+ console.log("[AUTH] Auth instance ID:", this.auth.__debugId || "no-id");
16097
+ if (!this.auth.__debugId) {
16098
+ this.auth.__debugId = "auth-" + Date.now();
16099
+ }
16100
+ console.log("[AUTH] Auth instance ID set to:", this.auth.__debugId);
16095
16101
  const practitionerService = new PractitionerService(this.db, this.auth, this.app);
16096
16102
  let user = null;
16097
16103
  try {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blackcode_sa/metaestetics-api",
3
3
  "private": false,
4
- "version": "1.14.7",
4
+ "version": "1.14.8",
5
5
  "description": "Firebase authentication service with anonymous upgrade support",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.mjs",
@@ -896,6 +896,13 @@ export class AuthService extends BaseService {
896
896
 
897
897
  // Verify auth state is correct
898
898
  console.log('[AUTH] Verifying auth.currentUser:', this.auth.currentUser?.uid || 'NULL');
899
+ // @ts-ignore - Debug: Add unique ID to track auth instance
900
+ console.log('[AUTH] Auth instance ID:', (this.auth as any).__debugId || 'no-id');
901
+ // @ts-ignore - Add debug ID if not exists
902
+ if (!(this.auth as any).__debugId) {
903
+ (this.auth as any).__debugId = 'auth-' + Date.now();
904
+ }
905
+ console.log('[AUTH] Auth instance ID set to:', (this.auth as any).__debugId);
899
906
 
900
907
  const practitionerService = new PractitionerService(this.db, this.auth, this.app);
901
908
 
@@ -91,6 +91,8 @@ export class UserService extends BaseService {
91
91
  ): Promise<User> {
92
92
  // DEBUG LOGGING - Check auth state before creating user document
93
93
  console.log('[USER_SERVICE] ====== CREATE USER DEBUG ======');
94
+ // @ts-ignore - Debug: Check auth instance ID
95
+ console.log('[USER_SERVICE] Auth instance ID:', (this.auth as any)?.__debugId || 'no-id');
94
96
  console.log('[USER_SERVICE] Current auth state:', {
95
97
  currentUser: this.auth?.currentUser?.uid || 'NULL',
96
98
  currentUserEmail: this.auth?.currentUser?.email || 'NULL',