mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
prom-client: fix warning
This commit is contained in:
1 parent
c394378dba
commit
d79643024a
2 files changed
+2
-2
No files matched your search
@@ -124,7 +124,7 @@ class UserLoginHandler extends Handler {
|
|||||||
this.limitRate('user_login', 60, 5),
|
this.limitRate('user_login', 60, 5),
|
||||||
oplog.log(this, 'user.login', { redirect }),
|
oplog.log(this, 'user.login', { redirect }),
|
||||||
]);
|
]);
|
||||||
// if (udoc._tfa && !verifyToken(udoc._tfa, tfa)) throw new InvalidTokenError('2FA token invalid.');
|
if (udoc._tfa && !verifyToken(udoc._tfa, tfa)) throw new InvalidTokenError('2FA token invalid.');
|
||||||
udoc.checkPassword(password);
|
udoc.checkPassword(password);
|
||||||
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
|
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
|
||||||
if (!udoc.hasPriv(PRIV.PRIV_USER_PROFILE)) throw new BlacklistedError(uname);
|
if (!udoc.hasPriv(PRIV.PRIV_USER_PROFILE)) throw new BlacklistedError(uname);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class MetricsHandler extends Handler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const [name, password] = SystemModel.getMany(['prom-client.name', 'prom-client.password']);
|
const [name, password] = SystemModel.getMany(['prom-client.name', 'prom-client.password']);
|
||||||
const key = this.request.headers.authorization?.split('Basic ')?.[1];
|
const key = this.request.headers.authorization.split('Basic ')?.[1];
|
||||||
if (!key || key !== Buffer.from(`${name}:${password}`).toString('base64')) {
|
if (!key || key !== Buffer.from(`${name}:${password}`).toString('base64')) {
|
||||||
this.response.status = 403;
|
this.response.status = 403;
|
||||||
this.response.body = {};
|
this.response.body = {};
|
||||||
|
|||||||
Reference in new issue
Block a user