Fix #1219: Make api work if requireAuth is enabled

pull/1257/head
Marcel Klehr 2012-12-05 14:04:48 +01:00
parent ce71002644
commit 377ff1eade
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ exports.basicAuth = function (req, res, next) {
}
var authorize = function (cb) {
// Do not require auth for static paths...this could be a bit brittle
if (req.path.match(/^\/(static|javascripts|pluginfw)/)) return cb(true);
// Do not require auth for static paths and the API...this could be a bit brittle
if (req.path.match(/^\/(static|javascripts|pluginfw|api)/)) return cb(true);
if (req.path.indexOf('/admin') != 0) {
if (!settings.requireAuthentication) return cb(true);