This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/node_modules/morgan/node_modules/basic-auth
2014-09-18 15:35:58 -04:00
..
index.js First commit 2014-09-18 15:35:58 -04:00
package.json First commit 2014-09-18 15:35:58 -04:00
Readme.md First commit 2014-09-18 15:35:58 -04:00

basic-auth

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