'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _nodeBits = require('node-bits');

var defaultSecurity = {
  required: true,
  username: 'username',
  password: 'password',
  expiresIn: { days: 1 }
};

exports.default = function (config) {
  var admin = '/admin';
  var security = _extends({}, defaultSecurity, config.security || {});

  return {
    verb: _nodeBits.GET,
    route: admin + '/login_info',
    implementation: {
      get: function get(req, res) {
        res.json(security);
      }
    }
  };
};