We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea35b24 commit ef94c64Copy full SHA for ef94c64
services/users/users.hooks.ts
@@ -3,16 +3,15 @@ import { HookContext } from '@feathersjs/feathers';
3
4
const hashPassword = hooks.hashPassword('password');
5
6
-const protectPassword = async (context: HookContext): Promise<HookContext> => {
7
- const { dispatch } = hooks.protect('password')(context);
8
- context.result = dispatch;
9
- context.dispatch = dispatch;
+const localDispatch = async (context: HookContext): Promise<HookContext> => {
+ context.result = context.dispatch;
10
return context;
11
}
12
13
export default {
14
after: {
15
- all: [protectPassword]
+ all: [hooks.protect('password')],
+ get: [localDispatch] // Protect password from local get's
16
},
17
before: {
18
create: [hashPassword],
0 commit comments