// Hooks for service `users`. (Can be re-generated.) import * as commonHooks from 'feathers-hooks-common'; import { HooksObject } from '@feathersjs/feathers'; import { hooks as authHooks } from '@feathersjs/authentication'; const { authenticate } = authHooks; // tslint:disable-next-line:no-unused-variable import { hooks as localAuthHooks } from '@feathersjs/authentication-local'; const { hashPassword, protect } = localAuthHooks; // tslint:disable-next-line:no-unused-variable import verifyEmail from './hooks/verify-email'; // !code: imports // !end // ! code: used // tslint:disable-next-line:no-unused-variable const { iff } = commonHooks; import validate from './users.validate'; // tslint:disable-next-line:no-unused-variable const { create, update, patch, validateCreate, validateUpdate, validatePatch } = validate; // !end // !code: init // !end let moduleExports: HooksObject = { before: { // Your hooks should include: // find : authenticate('jwt') // get : authenticate('jwt') // create: hashPassword() // update: hashPassword(), authenticate('jwt') // patch : hashPassword(), authenticate('jwt') // remove: authenticate('jwt') // ! code: before all: [], find: [ authenticate('jwt') ], get: [ authenticate('jwt') ], create: [ hashPassword() ], update: [ hashPassword(), authenticate('jwt') ], patch: [ hashPassword(), authenticate('jwt') ], remove: [ authenticate('jwt') ] // !end }, after: { // Your hooks should include: // all : protect('password') /* Must always be the last hook */ // ! code: after all: [ protect('password') /* Must always be the last hook */ ], find: [], get: [], create: [], update: [], patch: [], remove: [] // !end }, error: { // ! code: error all: [], find: [], get: [], create: [], update: [], patch: [], remove: [] // !end }, // !code: moduleExports // !end }; // !code: exports // !end export default moduleExports; // !code: funcs // !end // !code: end // !end