koa-auth-header

1.1.2 • Public • Published

koa-auth-header

Simple authorization header parser for koa.js framework

Usage

app = koa();
 
var authHeader = require('koa-auth-header')({
  required: true, // if the authorization are required, will throw a 401 if the header is not present,
  types: {
    // if the authorization header is Authorization: Bearer: sometoken
    Bearer: function(value) {
      this.request.token = value;
    }
  }
});
 
app.use(authHeader);

Package Sidebar

Install

npm i koa-auth-header

Weekly Downloads

1

Version

1.1.2

License

MIT

Last publish

Collaborators

  • sylvainv