diff --git a/lib/cartodb/controllers/analyses.js b/lib/cartodb/controllers/analyses.js index 4318340e..1a78208f 100644 --- a/lib/cartodb/controllers/analyses.js +++ b/lib/cartodb/controllers/analyses.js @@ -20,7 +20,7 @@ AnalysesController.prototype.register = function (app) { prepareResponse(), setCacheControlHeader(), sendResponse(), - unathorizedError() + unauthorizedError() ); }; @@ -112,7 +112,7 @@ function sendResponse () { }; } -function unathorizedError () { +function unauthorizedError () { return function unathorizedErrorMiddleware(err, req, res, next) { if (err.message.match(/permission\sdenied/)) { err = new Error('Unauthorized');