mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-09 08:25:00 -04:00
allows for multiple user logins along with live config file reading
This commit is contained in:
parent
cba2c1f83a
commit
d02643575e
2 changed files with 11 additions and 2 deletions
|
@ -24,8 +24,12 @@ exports.basicAuth = function (req, res, next) {
|
|||
// If a password has been set and auth headers are present...
|
||||
if (pass && req.headers.authorization && req.headers.authorization.search('Basic ') === 0) {
|
||||
// ...check login and password
|
||||
if (new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString() === pass) {
|
||||
return next();
|
||||
var userLogin = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString();
|
||||
settings.readConfig();
|
||||
for (var loginIndex in pass) {
|
||||
if (userLogin === pass[loginIndex]) {
|
||||
return next();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Do not require auth for static paths...this could be a bit brittle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue