From b044351f0ad554536df39ef61bc25870a7cd7a1e Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Fri, 28 Aug 2020 01:49:26 -0400 Subject: [PATCH] webaccess: Rename `basicAuth` to `checkAccess` Thanks to hooks, the function can do much more than just basic authentication. --- src/node/hooks/express/webaccess.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node/hooks/express/webaccess.js b/src/node/hooks/express/webaccess.js index 152b34e4e..b2ef5e599 100644 --- a/src/node/hooks/express/webaccess.js +++ b/src/node/hooks/express/webaccess.js @@ -8,8 +8,7 @@ const stats = require('ep_etherpad-lite/node/stats'); const sessionModule = require('express-session'); const cookieParser = require('cookie-parser'); -// checks for basic http auth -exports.basicAuth = (req, res, next) => { +exports.checkAccess = (req, res, next) => { const hookResultMangle = (cb) => { return (err, data) => { return cb(!err && data.length && data[0]); @@ -171,5 +170,5 @@ exports.expressConfigure = (hook_name, args, cb) => { args.app.use(cookieParser(settings.sessionKey, {})); - args.app.use(exports.basicAuth); + args.app.use(exports.checkAccess); };