@blackcode_sa/metaestetics-api 1.14.17 → 1.14.23
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/admin/index.js +2 -13
- package/dist/admin/index.mjs +2 -13
- package/dist/index.d.mts +11 -14
- package/dist/index.d.ts +11 -14
- package/dist/index.js +66 -170
- package/dist/index.mjs +119 -223
- package/package.json +1 -1
- package/src/admin/mailing/practitionerInvite/templates/invitation.template.ts +2 -13
- package/src/services/auth/auth.service.ts +9 -197
- package/src/services/practitioner/practitioner.service.ts +79 -4
- package/src/services/user/user.service.ts +1 -51
|
@@ -45,18 +45,6 @@ export class UserService extends BaseService {
|
|
|
45
45
|
) {
|
|
46
46
|
super(db, auth, app);
|
|
47
47
|
|
|
48
|
-
// DEBUG: Tag the auth instance
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
if (!this.auth.__userServiceId) {
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
this.auth.__userServiceId = 'user-service-' + Date.now();
|
|
53
|
-
}
|
|
54
|
-
// @ts-ignore
|
|
55
|
-
console.log('[USER_SERVICE] Constructor - auth ID:', this.auth.__userServiceId);
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
console.log('[USER_SERVICE] Constructor - auth.__authServiceId:', this.auth.__authServiceId || 'NOT SET');
|
|
58
|
-
|
|
59
|
-
// Kreiramo servise samo ako nisu prosleđeni
|
|
60
48
|
if (!patientService) {
|
|
61
49
|
patientService = new PatientService(db, auth, app);
|
|
62
50
|
}
|
|
@@ -100,27 +88,6 @@ export class UserService extends BaseService {
|
|
|
100
88
|
skipProfileCreation?: boolean;
|
|
101
89
|
},
|
|
102
90
|
): Promise<User> {
|
|
103
|
-
// DEBUG LOGGING - Check auth state before creating user document
|
|
104
|
-
console.log('[USER_SERVICE] ====== CREATE USER DEBUG ======');
|
|
105
|
-
// @ts-ignore - Debug: Check auth instance ID
|
|
106
|
-
console.log(this.auth)
|
|
107
|
-
console.log('[USER_SERVICE] Auth instance ID:', (this.auth as any)?.__debugId || 'no-id');
|
|
108
|
-
console.log('[USER_SERVICE] Current auth state:', {
|
|
109
|
-
currentUser: this.auth?.currentUser?.uid || 'NULL',
|
|
110
|
-
currentUserEmail: this.auth?.currentUser?.email || 'NULL',
|
|
111
|
-
currentUserProvider: this.auth?.currentUser?.providerId || 'NULL',
|
|
112
|
-
});
|
|
113
|
-
console.log('[USER_SERVICE] Firebase user passed to createUser:', {
|
|
114
|
-
uid: firebaseUser?.uid || 'NULL',
|
|
115
|
-
email: firebaseUser?.email || 'NULL',
|
|
116
|
-
providerId: firebaseUser?.providerId || 'NULL',
|
|
117
|
-
isAnonymous: firebaseUser?.isAnonymous,
|
|
118
|
-
});
|
|
119
|
-
console.log('[USER_SERVICE] Auth instances match:', this.auth?.currentUser?.uid === firebaseUser?.uid);
|
|
120
|
-
console.log('[USER_SERVICE] Document path:', `${USERS_COLLECTION}/${firebaseUser?.uid}`);
|
|
121
|
-
console.log('[USER_SERVICE] Roles:', roles);
|
|
122
|
-
console.log('[USER_SERVICE] ================================');
|
|
123
|
-
|
|
124
91
|
const userData: CreateUserData = {
|
|
125
92
|
uid: firebaseUser.uid,
|
|
126
93
|
email: firebaseUser.email,
|
|
@@ -131,24 +98,7 @@ export class UserService extends BaseService {
|
|
|
131
98
|
lastLoginAt: serverTimestamp(),
|
|
132
99
|
};
|
|
133
100
|
|
|
134
|
-
|
|
135
|
-
uid: userData.uid,
|
|
136
|
-
email: userData.email,
|
|
137
|
-
roles: userData.roles,
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
// Kreiramo osnovnog korisnika
|
|
141
|
-
try {
|
|
142
|
-
await setDoc(doc(this.db, USERS_COLLECTION, userData.uid), userData);
|
|
143
|
-
console.log('[USER_SERVICE] ✅ setDoc SUCCEEDED for:', userData.uid);
|
|
144
|
-
} catch (error: any) {
|
|
145
|
-
console.error('[USER_SERVICE] ❌ setDoc FAILED:', {
|
|
146
|
-
errorCode: error?.code,
|
|
147
|
-
errorMessage: error?.message,
|
|
148
|
-
uid: userData.uid,
|
|
149
|
-
});
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
101
|
+
await setDoc(doc(this.db, USERS_COLLECTION, userData.uid), userData);
|
|
152
102
|
|
|
153
103
|
// Kreiramo odgovarajuće profile na osnovu rola
|
|
154
104
|
if (options?.skipProfileCreation) {
|