mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
fix(core): Fix user telemetry bugs (#10293)
This commit is contained in:
@@ -89,6 +89,7 @@ export class MeController {
|
||||
|
||||
await this.externalHooks.run('user.profile.beforeUpdate', [userId, currentEmail, payload]);
|
||||
|
||||
const preUpdateUser = await this.userRepository.findOneByOrFail({ id: userId });
|
||||
await this.userService.update(userId, payload);
|
||||
const user = await this.userRepository.findOneOrFail({
|
||||
where: { id: userId },
|
||||
@@ -98,7 +99,10 @@ export class MeController {
|
||||
|
||||
this.authService.issueCookie(res, user, req.browserId);
|
||||
|
||||
const fieldsChanged = Object.keys(payload);
|
||||
const fieldsChanged = (Object.keys(payload) as Array<keyof UserUpdatePayload>).filter(
|
||||
(key) => payload[key] !== preUpdateUser[key],
|
||||
);
|
||||
|
||||
this.eventService.emit('user-updated', { user, fieldsChanged });
|
||||
|
||||
const publicUser = await this.userService.toPublic(user);
|
||||
|
||||
Reference in New Issue
Block a user