mirror of
https://github.com/dap-ps/discover.git
synced 2025-02-07 06:54:49 +00:00
fix usage of verifyUserAuth
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
f4dd909c15
commit
92e873a693
@ -5,15 +5,15 @@ const config = require('../../config')
|
||||
class AdminAuthorizationMiddleware {
|
||||
static verifyUserAuth(auth) {
|
||||
return (
|
||||
authorization.username == config.ADMIN_USER &&
|
||||
authorization.password == config.ADMIN_PASSWORD
|
||||
auth.username == config.ADMIN_USER &&
|
||||
auth.password == config.ADMIN_PASSWORD
|
||||
)
|
||||
}
|
||||
|
||||
static authorize(req, res, next) {
|
||||
try {
|
||||
let authorization = parseBasicAuthorization(req.headers.authorization);
|
||||
if (this.verifyUserAuth(authorization)) {
|
||||
if (AdminAuthorizationMiddleware.verifyUserAuth(authorization)) {
|
||||
return void next();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user