aboutsummaryrefslogtreecommitdiff
path: root/services/users
diff options
context:
space:
mode:
Diffstat (limited to 'services/users')
-rw-r--r--services/users/users.hooks.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts
index 398d058..64b322a 100644
--- a/services/users/users.hooks.ts
+++ b/services/users/users.hooks.ts
@@ -1,14 +1,10 @@
import _ from 'lodash';
import { hooks } from '@feathersjs/authentication-local';
+import { discard } from 'feathers-hooks-common';
import { HookContext } from '@feathersjs/feathers';
const hashPassword = hooks.hashPassword('password');
-const localDispatch = async (context: HookContext): Promise<HookContext> => {
- context.result = context.dispatch;
- return context;
-};
-
const ignoreCaseRegex = async (context: HookContext): Promise<HookContext> => {
context.params.query = _.mapValues(context.params.query, data => {
return _.set(data, '$options', 'i');
@@ -19,7 +15,7 @@ const ignoreCaseRegex = async (context: HookContext): Promise<HookContext> => {
export default {
after: {
all: hooks.protect('password'),
- get: localDispatch, // Protect password from local get's
+ get: discard('password'), // Protect password from local get's
},
before: {
find: ignoreCaseRegex,