'use strict'; const globalHooks = require('../../../hooks'); const hooks = require('feathers-hooks'); const auth = require('feathers-authentication').hooks; exports.before = { all: [], find: [ auth.verifyToken(), auth.populateUser(), auth.restrictToAuthenticated() ], get: [ auth.verifyToken(), auth.populateUser(), auth.restrictToAuthenticated(), auth.restrictToOwner({ ownerField: 'id' }) ], create: [ auth.hashPassword() ], update: [ auth.verifyToken(), auth.populateUser(), auth.restrictToAuthenticated(), auth.restrictToOwner({ ownerField: 'id' }) ], patch: [ auth.verifyToken(), auth.populateUser(), auth.restrictToAuthenticated(), auth.restrictToOwner({ ownerField: 'id' }) ], remove: [ auth.verifyToken(), auth.populateUser(), auth.restrictToAuthenticated(), auth.restrictToOwner({ ownerField: 'id' }) ] }; exports.after = { all: [hooks.remove('password')], find: [], get: [], create: [], update: [], patch: [], remove: [] };