koa-www-authenticate
v0.1.1
Published
Add WWW-Authenticate header on 401 errors
Downloads
2
Maintainers
Readme
koa-www-authenticate
Add WWW-Authenticate header on 401 errors
Usage
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"'