🐛 Fix issue with the gallery login

This commit is contained in:
Antonio M A 2020-07-02 15:14:25 +02:00
parent 1f1019d59f
commit ee4eeb53ae
1 changed files with 6 additions and 2 deletions

View File

@ -9,8 +9,12 @@ async function post(req, res) {
const userIP = req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.socket.remoteAddress || req.connection.socket.remoteAddress;
res.setHeader('Content-Type', 'text/html');
const protocol = this.protocol();
const password = this.c.admin.key;
if (req.body.password !== this.c.admin.key) {
var password = this.c.admin.key;
// Compatibility with old config
if(typeof password == "string"){
password = [password];
}
if (!this.c.admin.key.includes(req.body.password)) {
res.statusCode = 401;
res.render('unauthorized');
res.end();