Skip to content

Commit

Permalink
pass sanitized user to the user.profile.update hook
Browse files Browse the repository at this point in the history
  • Loading branch information
netroy committed Sep 2, 2022
1 parent 08ecb0b commit cfd2887
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/UserManagement/routes/me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function meNamespace(this: N8nApp): void {
user_id: req.user.id,
fields_changed: updatedkeys,
});
await this.externalHooks.run('user.profile.update', [currentEmail, req.body]);
await this.externalHooks.run('user.profile.update', [currentEmail, sanitizeUser(user)]);

return sanitizeUser(user);
},
Expand Down
9 changes: 1 addition & 8 deletions packages/cli/src/UserManagement/routes/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,14 +365,7 @@ export function usersNamespace(this: N8nApp): void {
user_id: invitee.id,
});

await this.externalHooks.run('user.profile.update', [
invitee.email,
{
firstName,
lastName,
email: invitee.email,
},
]);
await this.externalHooks.run('user.profile.update', [invitee.email, sanitizeUser(invitee)]);
await this.externalHooks.run('user.password.update', [invitee.email, invitee.password]);

return sanitizeUser(updatedUser);
Expand Down

0 comments on commit cfd2887

Please sign in to comment.