Skip to content

Commit

Permalink
Handles options somewhat better.
Browse files Browse the repository at this point in the history
  • Loading branch information
badave committed Jan 11, 2013
1 parent 6986e76 commit 1cd8c00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/authenticate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ authenticate.deserializeToken = function(access_token) {

authenticate.middleware = function(options) {
var self = this;

this.options = options || {};
_.extend(this.defaults, this.options);

this.options = {};
options = options || {};
_.extend(this.options, this.defaults, options);

if(!this.options.encrypt_key || !this.options.validate_key) {
throw new Error("Encrypt key and validate key required by authenticate.middleware. Example: authenticate.middleware({encrypt_key: 'crypt', validate_key: 'sign'})");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "authenticate",
"main": "./lib/authenticate",
"version": "0.1.0",
"version": "0.1.1",
"description": "Access token authentication middleware for Express, NodeJS",
"author": {
"name": "David Badley",
Expand Down

0 comments on commit 1cd8c00

Please sign in to comment.