basic-auth

generic basic auth parser

basic-auth

Generic basic auth Authorization header field parser for whatever.

$ npm install basic-auth

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

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

License

MIT