Skip to content

Commit 12507d3

Browse files
authored
fix(cli): password reset should trigger internal and external hooks (#4066)
Ticket: N8N-4586
1 parent eebc51e commit 12507d3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

packages/cli/src/UserManagement/routes/passwordReset.ts

+7
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,13 @@ export function passwordResetNamespace(this: N8nApp): void {
215215
Logger.info('User password updated successfully', { userId });
216216

217217
await issueCookie(res, user);
218+
219+
void InternalHooksManager.getInstance().onUserUpdate({
220+
user_id: userId,
221+
fields_changed: ['password'],
222+
});
223+
224+
await this.externalHooks.run('user.password.update', [user.email, password]);
218225
}),
219226
);
220227
}

packages/cli/test/integration/shared/utils.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ export async function initTestServer({
101101
if (
102102
endpointGroups.includes('credentials') ||
103103
endpointGroups.includes('me') ||
104-
endpointGroups.includes('users')
104+
endpointGroups.includes('users') ||
105+
endpointGroups.includes('passwordReset')
105106
) {
106107
testServer.externalHooks = ExternalHooks();
107108
}

0 commit comments

Comments
 (0)