basic-auth

generic basic auth parser

npm install basic-auth
51 downloads in the last day
478 downloads in the last week
2 876 downloads in the last month

name

Generic basic auth Authorization header field parser for whatever.

Installation

$ npm install basic-auth

Example

Pass a node request or koa Context object to the module exported. If parsing fails undefined is returned, otherwise an object with .name and .pass.

var auth = require('basic-auth');
var user = auth(req);
// => { name: 'something', pass: 'whatever' }

License

MIT

npm loves you