mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-11 02:32:41 +00:00
i messed up authentication entirely, this commit restores it
This commit is contained in:
@@ -21,7 +21,10 @@ const mw = {
|
|||||||
loginLimiter,
|
loginLimiter,
|
||||||
(req, res, next) => {
|
(req, res, next) => {
|
||||||
if (!req.get('authorization')) {
|
if (!req.get('authorization')) {
|
||||||
throw { HBErrorCode: '401', code: 401, message: 'Authorization Required' };
|
return res
|
||||||
|
.set('WWW-Authenticate', 'Basic realm="Authorization Required"')
|
||||||
|
.status(401)
|
||||||
|
.send('Authorization Required');
|
||||||
}
|
}
|
||||||
const [username, password] = Buffer.from(req.get('authorization').split(' ').pop(), 'base64')
|
const [username, password] = Buffer.from(req.get('authorization').split(' ').pop(), 'base64')
|
||||||
.toString('ascii')
|
.toString('ascii')
|
||||||
|
|||||||
Reference in New Issue
Block a user