mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Merge pull request #17 from nashe/patch-admin-bypass
Case-insensitive check /admin/ access restriction
This commit is contained in:
commit
76cd39d11a
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ exports.basicAuth = function (req, res, next) {
|
||||||
// Do not require auth for static paths and the API...this could be a bit brittle
|
// 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.match(/^\/(static|javascripts|pluginfw|api)/)) return cb(true);
|
||||||
|
|
||||||
if (req.path.indexOf('/admin') != 0) {
|
if (req.path.toLowerCase().indexOf('/admin') != 0) {
|
||||||
if (!settings.requireAuthentication) return cb(true);
|
if (!settings.requireAuthentication) return cb(true);
|
||||||
if (!settings.requireAuthorization && req.session && req.session.user) return cb(true);
|
if (!settings.requireAuthorization && req.session && req.session.user) return cb(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue