Context and Controller
Context
Context.prototype.configure = function(app, server, callback)
{
var httpAuth = new (greppy.get('auth.handler.http'))({
adapter: [
new (greppy.get('auth.adapter.array'))({
users: [
{username: 'admin', password: 'admin'}
]
}),
new (greppy.get('auth.adapter.htpasswd'))({
file: __dirname + '/../config/htpasswd'
})
]
});
app.set('auth.http', httpAuth);
}
Controller
Controller.prototype.configure = function(app, server, callback)
{
this.options.auth.handler = app.get('auth.http');
this.options.auth.routes = [];
callback && callback();
};