message: Allow manipulation of params before checking credentials
  * Allow manipulation of params before checking credentials
  Closes feathersjs/feathers-authentication#165 Closes feathersjs/feathers-authentication#171
  * buildCredentials for local auth service
  * Move passReqToCallback into defaults
diff: @@ -10,6 +10,7 @@ const debug = Debug('feathers-authentication:local');
  const defaults = {
  usernameField: 'email',
  passwordField: 'password',
  + passReqToCallback: true,
  session: false
  };
  @@ -18,16 +19,24 @@ export class Service {
  this.options = options;
  }
  - checkCredentials(username, password, done) {
  + buildCredentials(req, username) {
  + const usernameField = this.options.usernameField;
  + return new Promise(function(resolve) {
  const params = {
  query: {
  - [this.options.usernameField]: username
  + [usernameField]: username
  }
  };
  + resolve(params);
  + });
  + }
  + checkCredentials(req, username, password, done) {
  + this.app.service(this.options.localEndpoint).buildCredentials(req, username, password)
  + .then(params => {
  // Look up the user
  - this.app.service(this.options.userEndpoint)
  - .find(params)
  + return this.app.service(this.options.userEndpoint).find(params);
  + })
  .then(users => {
  // Paginated services return the array of results in the data attribute.
  let user = users[0] || users.data && users.data[0];
  