Skip to content

Commit 13d18af

Browse files
committed
Merge branch 'develop'
2 parents 3498fbc + db7648c commit 13d18af

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: lib/common/makeSetup.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ var cors_middleware = function (req, res, next) {
88
res.setHeader('Access-Control-Allow-Headers', 'Authorization, Content-Type');
99
next();
1010
};
11-
1211
module.exports = function makeSetup(grantTypes, reqPropertyName, requiredHooks, grantToken) {
1312
var errorSenders = require("./makeErrorSenders")(grantTypes);
1413
var handleAuthenticatedResource = require("./makeHandleAuthenticatedResource")(reqPropertyName, errorSenders);
@@ -51,7 +50,7 @@ module.exports = function makeSetup(grantTypes, reqPropertyName, requiredHooks,
5150
if (req.method === "POST" && req.path() === options.tokenEndpoint) {
5251
// This is handled by the route installed above, so do nothing.
5352
next();
54-
} else if (req.authorization.scheme) {
53+
} else if (req.authorization && req.authorization.scheme) {
5554
handleAuthenticatedResource(req, res, next, options);
5655
} else {
5756
req[reqPropertyName] = null;

0 commit comments

Comments
 (0)