aboutsummaryrefslogtreecommitdiff
path: root/services/users/users.hooks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'services/users/users.hooks.ts')
-rw-r--r--services/users/users.hooks.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts
index fc17ed7..8eecca3 100644
--- a/services/users/users.hooks.ts
+++ b/services/users/users.hooks.ts
@@ -1,11 +1,17 @@
import { hooks } from '@feathersjs/authentication-local';
+import { HookContext } from '@feathersjs/feathers';
const hashPassword = hooks.hashPassword('password');
-const protectPassword = hooks.protect('password');
+
+const localDispatch = async (context: HookContext): Promise<HookContext> => {
+ context.result = context.dispatch;
+ return context;
+}
export default {
after: {
- all: [protectPassword]
+ all: [hooks.protect('password')],
+ get: [localDispatch] // Protect password from local get's
},
before: {
create: [hashPassword],