0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-05 05:52:46 +00:00

Update Buffer method

This commit is contained in:
G.Ambatte
2023-01-04 22:08:22 +13:00
parent 2b824839c3
commit 4a449c7895

View File

@@ -16,7 +16,7 @@ const mw = {
.status(401) .status(401)
.send('Authorization Required'); .send('Authorization Required');
} }
const [username, password] = new Buffer(req.get('authorization').split(' ').pop(), 'base64') const [username, password] = Buffer.from(req.get('authorization').split(' ').pop(), 'base64')
.toString('ascii') .toString('ascii')
.split(':'); .split(':');
if(process.env.ADMIN_USER === username && process.env.ADMIN_PASS === password){ if(process.env.ADMIN_USER === username && process.env.ADMIN_PASS === password){