From 8cb4ed0435ea277f1528860ec6ae88368f42608d Mon Sep 17 00:00:00 2001 From: Amir Malik Date: Thu, 26 Jan 2012 10:30:38 -0800 Subject: [PATCH] Fall-through to next middleware if Authorization isn't of type Bearer. This should allow standard HTTP auth to function in a subsequent middleware down the stack. Closes #6 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9fc1691..c904edc 100644 --- a/index.js +++ b/index.js @@ -33,7 +33,7 @@ OAuth2Provider.prototype.login = function() { if(req.query['access_token']) { atok = req.query['access_token']; - } else if(req.headers['authorization']) { + } else if((req.headers['authorization'] || '').indexOf('Bearer ') == 0) { atok = req.headers['authorization'].replace('Bearer', '').trim(); } else { return next();