const { AuthenticationService, JWTStrategy } = require('@feathersjs/authentication'); const { LocalStrategy } = require('@feathersjs/authentication-local'); const _ = require('lodash'); class NoHashingLocalStrategy extends LocalStrategy { async comparePassword (entity, password) { const { entityPasswordField, errorMessage } = this.configuration; const entityPassword = _.get(entity, entityPasswordField); if (entityPassword !== password) throw new Error(errorMessage); return entity; } } module.exports = app => { const authentication = new AuthenticationService(app); authentication.register('local', new NoHashingLocalStrategy()); authentication.register('jwt', new JWTStrategy()); app.use('/authentication', authentication); };