mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
allow users to have colons in password
This commit is contained in:
parent
c08a4dd01f
commit
43e1af93c1
1 changed files with 2 additions and 2 deletions
|
@ -32,8 +32,8 @@ exports.basicAuth = function (req, res, next) {
|
||||||
// If auth headers are present use them to authenticate...
|
// If auth headers are present use them to authenticate...
|
||||||
if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) {
|
if (req.headers.authorization && req.headers.authorization.search('Basic ') === 0) {
|
||||||
var userpass = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString().split(":")
|
var userpass = new Buffer(req.headers.authorization.split(' ')[1], 'base64').toString().split(":")
|
||||||
var username = userpass[0];
|
var username = userpass.shift();
|
||||||
var password = userpass[1];
|
var password = userpass.join(':');
|
||||||
|
|
||||||
if (settings.users[username] != undefined && settings.users[username].password == password) {
|
if (settings.users[username] != undefined && settings.users[username].password == password) {
|
||||||
settings.users[username].username = username;
|
settings.users[username].username = username;
|
||||||
|
|
Loading…
Reference in a new issue