File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
2
import { hooks } from '@feathersjs/authentication-local' ;
3
+ import { discard } from 'feathers-hooks-common' ;
3
4
import { HookContext } from '@feathersjs/feathers' ;
4
5
5
6
const hashPassword = hooks . hashPassword ( 'password' ) ;
6
7
7
- const localDispatch = async ( context : HookContext ) : Promise < HookContext > => {
8
- context . result = context . dispatch ;
9
- return context ;
10
- } ;
11
-
12
8
const ignoreCaseRegex = async ( context : HookContext ) : Promise < HookContext > => {
13
9
context . params . query = _ . mapValues ( context . params . query , data => {
14
10
return _ . set ( data , '$options' , 'i' ) ;
@@ -19,7 +15,7 @@ const ignoreCaseRegex = async (context: HookContext): Promise<HookContext> => {
19
15
export default {
20
16
after : {
21
17
all : hooks . protect ( 'password' ) ,
22
- get : localDispatch , // Protect password from local get's
18
+ get : discard ( 'password' ) , // Protect password from local get's
23
19
} ,
24
20
before : {
25
21
find : ignoreCaseRegex ,
You can’t perform that action at this time.
0 commit comments