mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix(cli): password reset should trigger internal and external hooks (#4066)
Ticket: N8N-4586
This commit is contained in:
parent
eebc51ec7c
commit
12507d39d6
|
@ -215,6 +215,13 @@ export function passwordResetNamespace(this: N8nApp): void {
|
||||||
Logger.info('User password updated successfully', { userId });
|
Logger.info('User password updated successfully', { userId });
|
||||||
|
|
||||||
await issueCookie(res, user);
|
await issueCookie(res, user);
|
||||||
|
|
||||||
|
void InternalHooksManager.getInstance().onUserUpdate({
|
||||||
|
user_id: userId,
|
||||||
|
fields_changed: ['password'],
|
||||||
|
});
|
||||||
|
|
||||||
|
await this.externalHooks.run('user.password.update', [user.email, password]);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,8 @@ export async function initTestServer({
|
||||||
if (
|
if (
|
||||||
endpointGroups.includes('credentials') ||
|
endpointGroups.includes('credentials') ||
|
||||||
endpointGroups.includes('me') ||
|
endpointGroups.includes('me') ||
|
||||||
endpointGroups.includes('users')
|
endpointGroups.includes('users') ||
|
||||||
|
endpointGroups.includes('passwordReset')
|
||||||
) {
|
) {
|
||||||
testServer.externalHooks = ExternalHooks();
|
testServer.externalHooks = ExternalHooks();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue