diff --git a/src/node/db/SecurityManager.js b/src/node/db/SecurityManager.js index bc8f59426..e9aefcd61 100644 --- a/src/node/db/SecurityManager.js +++ b/src/node/db/SecurityManager.js @@ -27,6 +27,7 @@ var sessionManager = require("./SessionManager"); var settings = require("../utils/Settings"); var log4js = require('log4js'); var authLogger = log4js.getLogger("auth"); +const thenify = require("thenify").withCallback; /** * This function controlls the access to a pad, it checks if the user can access a pad. @@ -36,7 +37,7 @@ var authLogger = log4js.getLogger("auth"); * @param password the password the user has given to access this pad, can be null * @param callback will be called with (err, {accessStatus: grant|deny|wrongPassword|needPassword, authorID: a.xxxxxx}) */ -exports.checkAccess = function(padID, sessionCookie, token, password, callback) +exports.checkAccess = thenify(function(padID, sessionCookie, token, password, callback) { var statusObject; @@ -300,4 +301,4 @@ exports.checkAccess = function(padID, sessionCookie, token, password, callback) callback(null, statusObject); }); -}; +});