Add WWW-Authenticate header on 401 errors
npm install koa-www-authenticatekoa-www-authenticate
====================
Add WWW-Authenticate header on 401 errors
``
wwwAuthenticate = require('koa-www-authenticate');
app.use(wwwAuthenticate({
realm: 'foo',
scheme: 'Basic'
}));
app.use(function *(next) {
this.throw(401, "Test www-authenticate");
});
// Response will have 'WWW-Authenticate' header set to 'Basic realm="foo"'
``