code: function Strategy(options, verify) {
    if (typeof options === 'function') {
      verify = options;
      options = {};
    }
  
    if (typeof verify !== 'function') {
      throw new TypeError('JsonStrategy requires a verify callback');
    }
  
    this._usernameProp = options.usernameProp || 'username';
    this._passwordProp = options.passwordProp || 'password';
  
    passport.Strategy.call(this);
    this.name = 'json';
    this._verify = verify;
    this._passReqToCallback = options.passReqToCallback;
    this._allowEmptyPasswords = !!options.allowEmptyPasswords;
  }
docs: `Strategy` constructor.
  
  The JSON authentication strategy authenticates requests based on the
  credentials submitted through a JSON-based login form or REST call.
  
  Applications must supply a `verify` callback which accepts `username` and
  `password` credentials, and then calls the `done` callback supplying a
  `user`, which should be set to `false` if the credentials are not valid.
  If an exception occured, `err` should be set.
  
  Optionally, `options` can be used to change the fields in which the
  credentials are found.
  
  Options:
  - `usernameProp`  property name/path where the username is found, defaults to `'username'`
  - `passwordProp`  property name/path where the password is found, defaults to `'password'`
  - `passReqToCallback`  when `true`, `req` is the first argument to the verify callback (default: `false`)
  - `allowEmptyPasswords`  when `true`, it will allow the password to be an empty string (default: `false`)
  
  Examples:
  
  passport.use(new JsonStrategy(
  function(username, password, done) {
  User.findOne({ username: username, password: password }, function (err, user) {
  done(err, user);
  });
  }
  ));
  
  @param {Object} options
  @param {Function} verify
  @constructor
  @api public