aboutsummaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/users/users.hooks.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts
index fc17ed7..580d1d2 100644
--- a/services/users/users.hooks.ts
+++ b/services/users/users.hooks.ts
@@ -1,7 +1,14 @@
import { hooks } from '@feathersjs/authentication-local';
+import { HookContext } from '@feathersjs/feathers';
const hashPassword = hooks.hashPassword('password');
-const protectPassword = hooks.protect('password');
+
+const protectPassword = async (context: HookContext): Promise<HookContext> => {
+ const { dispatch } = hooks.protect('password')(context);
+ context.result = dispatch;
+ context.dispatch = dispatch;
+ return context;
+}
export default {
after: {