diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-08-12 19:09:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 19:09:54 +0300 |
commit | 5462174ca076aef53d06b92372141c665c923ea3 (patch) | |
tree | 1bbe4629b0a0ee537a21be15c91fd31b243df97d /services/users | |
parent | c2e16321e679d52ad9d6e08b5cdb785b172ad830 (diff) | |
parent | 8f4ae4fd89cab5ba4f9e8d2750bc8589ce997ff1 (diff) | |
download | which-api-5462174ca076aef53d06b92372141c665c923ea3.tar.gz |
Merge pull request #19 from which-ecosystem/s3-reuploads
S3 reuploads
Diffstat (limited to 'services/users')
-rw-r--r-- | services/users/users.hooks.ts | 3 |
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: { |