From fc4bdecdcd8abc7a2adaeb4b7f209f6930846ffa Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 14 Jun 2020 17:09:19 +0300 Subject: feat: use hashPassword hook --- services/users/users.hooks.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 services/users/users.hooks.ts (limited to 'services/users/users.hooks.ts') diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts new file mode 100644 index 0000000..06cbfde --- /dev/null +++ b/services/users/users.hooks.ts @@ -0,0 +1,12 @@ +import { hooks } from '@feathersjs/authentication-local'; + +const hashPassword = hooks.hashPassword('password'); + +export default { + before: { + create: [hashPassword], + patch: [hashPassword], + update: [hashPassword] + } +}; + -- cgit v1.2.3