mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
webaccess: Rename basicAuth
to checkAccess
Thanks to hooks, the function can do much more than just basic authentication.
This commit is contained in:
parent
2830aaebf1
commit
b044351f0a
1 changed files with 2 additions and 3 deletions
|
@ -8,8 +8,7 @@ const stats = require('ep_etherpad-lite/node/stats');
|
||||||
const sessionModule = require('express-session');
|
const sessionModule = require('express-session');
|
||||||
const cookieParser = require('cookie-parser');
|
const cookieParser = require('cookie-parser');
|
||||||
|
|
||||||
// checks for basic http auth
|
exports.checkAccess = (req, res, next) => {
|
||||||
exports.basicAuth = (req, res, next) => {
|
|
||||||
const hookResultMangle = (cb) => {
|
const hookResultMangle = (cb) => {
|
||||||
return (err, data) => {
|
return (err, data) => {
|
||||||
return cb(!err && data.length && data[0]);
|
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(cookieParser(settings.sessionKey, {}));
|
||||||
|
|
||||||
args.app.use(exports.basicAuth);
|
args.app.use(exports.checkAccess);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue