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.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts
index 29f1074..ddfc47f 100644
--- a/services/users/users.hooks.ts
+++ b/services/users/users.hooks.ts
@@ -4,6 +4,7 @@ import { discard, disallow } from 'feathers-hooks-common';
import { HookContext } from '@feathersjs/feathers';
import { NotAuthenticated } from '@feathersjs/errors';
import requireAuth from '../../hooks/requireAuth';
+import fetchImages from '../../hooks/fetchImages';
const hashPassword = hooks.hashPassword('password');
@@ -24,6 +25,8 @@ const compareUser = async (context: HookContext): Promise<HookContext> => {
export default {
after: {
all: hooks.protect('password'),
+ create: fetchImages(['avatarUrl']),
+ patch: fetchImages(['avatarUrl']),
get: discard('password') // Protect password from local get's
},
before: {