@blackcode_sa/metaestetics-api 1.14.2 → 1.14.3
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 +7 -23
- package/dist/index.mjs +7 -23
- package/package.json +1 -1
- package/src/services/auth/auth.service.ts +11 -27
package/dist/index.js
CHANGED
|
@@ -16117,30 +16117,14 @@ var AuthService = class extends BaseService {
|
|
|
16117
16117
|
404
|
|
16118
16118
|
);
|
|
16119
16119
|
}
|
|
16120
|
-
console.log("[AUTH] Draft profiles found,
|
|
16120
|
+
console.log("[AUTH] Draft profiles found, returning to client for selection");
|
|
16121
16121
|
const draftProfilesFound = await practitionerService2.getDraftProfilesByEmail(normalizedEmail);
|
|
16122
|
-
|
|
16123
|
-
|
|
16124
|
-
|
|
16125
|
-
|
|
16126
|
-
|
|
16127
|
-
}
|
|
16128
|
-
console.error("[AUTH] Error creating user document:", {
|
|
16129
|
-
error: createError,
|
|
16130
|
-
code: createError == null ? void 0 : createError.code,
|
|
16131
|
-
message: createError == null ? void 0 : createError.message
|
|
16132
|
-
});
|
|
16133
|
-
try {
|
|
16134
|
-
await (0, import_auth8.signOut)(this.auth);
|
|
16135
|
-
} catch (signOutError) {
|
|
16136
|
-
console.warn("[AUTH] Error signing out Firebase user (non-critical):", signOutError);
|
|
16137
|
-
}
|
|
16138
|
-
throw new AuthError(
|
|
16139
|
-
"Unable to create account. Please use the token provided by your clinic to register, or contact support.",
|
|
16140
|
-
"AUTH/USER_CREATION_FAILED",
|
|
16141
|
-
500
|
|
16142
|
-
);
|
|
16143
|
-
}
|
|
16122
|
+
return {
|
|
16123
|
+
user: null,
|
|
16124
|
+
// Will be created when claiming profiles
|
|
16125
|
+
practitioner: null,
|
|
16126
|
+
draftProfiles: draftProfilesFound
|
|
16127
|
+
};
|
|
16144
16128
|
}
|
|
16145
16129
|
if (!existingUser2) {
|
|
16146
16130
|
await (0, import_auth8.signOut)(this.auth);
|
package/dist/index.mjs
CHANGED
|
@@ -16204,30 +16204,14 @@ var AuthService = class extends BaseService {
|
|
|
16204
16204
|
404
|
|
16205
16205
|
);
|
|
16206
16206
|
}
|
|
16207
|
-
console.log("[AUTH] Draft profiles found,
|
|
16207
|
+
console.log("[AUTH] Draft profiles found, returning to client for selection");
|
|
16208
16208
|
const draftProfilesFound = await practitionerService2.getDraftProfilesByEmail(normalizedEmail);
|
|
16209
|
-
|
|
16210
|
-
|
|
16211
|
-
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
}
|
|
16215
|
-
console.error("[AUTH] Error creating user document:", {
|
|
16216
|
-
error: createError,
|
|
16217
|
-
code: createError == null ? void 0 : createError.code,
|
|
16218
|
-
message: createError == null ? void 0 : createError.message
|
|
16219
|
-
});
|
|
16220
|
-
try {
|
|
16221
|
-
await firebaseSignOut(this.auth);
|
|
16222
|
-
} catch (signOutError) {
|
|
16223
|
-
console.warn("[AUTH] Error signing out Firebase user (non-critical):", signOutError);
|
|
16224
|
-
}
|
|
16225
|
-
throw new AuthError(
|
|
16226
|
-
"Unable to create account. Please use the token provided by your clinic to register, or contact support.",
|
|
16227
|
-
"AUTH/USER_CREATION_FAILED",
|
|
16228
|
-
500
|
|
16229
|
-
);
|
|
16230
|
-
}
|
|
16209
|
+
return {
|
|
16210
|
+
user: null,
|
|
16211
|
+
// Will be created when claiming profiles
|
|
16212
|
+
practitioner: null,
|
|
16213
|
+
draftProfiles: draftProfilesFound
|
|
16214
|
+
};
|
|
16231
16215
|
}
|
|
16232
16216
|
if (!existingUser2) {
|
|
16233
16217
|
await firebaseSignOut(this.auth);
|
package/package.json
CHANGED
|
@@ -1099,35 +1099,19 @@ export class AuthService extends BaseService {
|
|
|
1099
1099
|
);
|
|
1100
1100
|
}
|
|
1101
1101
|
|
|
1102
|
-
// Draft profiles exist -
|
|
1103
|
-
//
|
|
1104
|
-
|
|
1102
|
+
// Draft profiles exist - return them to client
|
|
1103
|
+
// User document creation will happen server-side when claiming profiles
|
|
1104
|
+
// This avoids permission issues with client-side User document creation
|
|
1105
|
+
console.log('[AUTH] Draft profiles found, returning to client for selection');
|
|
1105
1106
|
const draftProfilesFound = await practitionerService.getDraftProfilesByEmail(normalizedEmail);
|
|
1106
1107
|
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
error: createError,
|
|
1115
|
-
code: createError?.code,
|
|
1116
|
-
message: createError?.message,
|
|
1117
|
-
});
|
|
1118
|
-
// If creation fails, sign out and throw error
|
|
1119
|
-
// User will need to use token flow or contact support
|
|
1120
|
-
try {
|
|
1121
|
-
await firebaseSignOut(this.auth);
|
|
1122
|
-
} catch (signOutError) {
|
|
1123
|
-
console.warn('[AUTH] Error signing out Firebase user (non-critical):', signOutError);
|
|
1124
|
-
}
|
|
1125
|
-
throw new AuthError(
|
|
1126
|
-
'Unable to create account. Please use the token provided by your clinic to register, or contact support.',
|
|
1127
|
-
'AUTH/USER_CREATION_FAILED',
|
|
1128
|
-
500,
|
|
1129
|
-
);
|
|
1130
|
-
}
|
|
1108
|
+
// Return draft profiles without creating User document
|
|
1109
|
+
// The User document will be created server-side via Cloud Function when claiming profiles
|
|
1110
|
+
return {
|
|
1111
|
+
user: null, // Will be created when claiming profiles
|
|
1112
|
+
practitioner: null,
|
|
1113
|
+
draftProfiles: draftProfilesFound,
|
|
1114
|
+
};
|
|
1131
1115
|
}
|
|
1132
1116
|
|
|
1133
1117
|
// User document exists - check for practitioner profile and draft profiles
|