Skip to content

Commit d1c4620

Browse files
authored
refactor(core): experience API minor code logic refactor (#7101)
refactor(core): optimize experience API code logic Refactored parts of the experience API code logic to improve maintainability
1 parent cc4a004 commit d1c4620

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

packages/core/src/routes/experience/classes/experience-interaction.ts

+1
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ export default class ExperienceInteraction {
287287
await this.profile.assertUserMandatoryProfileFulfilled();
288288

289289
const user = await this.provisionLibrary.createUser(this.profile.data);
290+
log?.append({ user });
290291

291292
this.userId = user.id;
292293
this.userCache = user;

packages/core/src/routes/experience/classes/libraries/provision-library.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export class ProvisionLibrary {
5555
libraries: {
5656
users: { generateUserId, insertUser },
5757
},
58-
queries: { userSsoIdentities: userSsoIdentitiesQueries },
5958
} = this.tenantContext;
6059

6160
const { socialIdentity, enterpriseSsoIdentity, syncedEnterpriseSsoIdentity, ...rest } = profile;
@@ -74,11 +73,7 @@ export class ProvisionLibrary {
7473
);
7574

7675
if (enterpriseSsoIdentity) {
77-
await userSsoIdentitiesQueries.insert({
78-
id: generateStandardId(),
79-
userId: user.id,
80-
...enterpriseSsoIdentity,
81-
});
76+
await this.addSsoIdentityToUser(user.id, enterpriseSsoIdentity);
8277
}
8378

8479
if (isCreatingFirstAdminUser) {
@@ -88,7 +83,6 @@ export class ProvisionLibrary {
8883
await this.provisionNewUserJitOrganizations(user.id, profile);
8984

9085
this.ctx.appendDataHookContext('User.Created', { user });
91-
// TODO: log
9286

9387
this.triggerAnalyticReports(user);
9488

0 commit comments

Comments
 (0)