mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 20:42:43 +00:00
i messed up authentication entirely, this commit restores it
This commit is contained in:
@@ -21,7 +21,10 @@ const mw = {
|
||||
loginLimiter,
|
||||
(req, res, next) => {
|
||||
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')
|
||||
.toString('ascii')
|
||||
|
||||
Reference in New Issue
Block a user