koa-www-authenticate

0.1.1 • Public • Published

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"'

Dependents (0)

Package Sidebar

Install

npm i koa-www-authenticate

Weekly Downloads

1

Version

0.1.1

License

ISC

Last publish

Collaborators

  • alxarch