mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 02:43:59 +00:00
SYNC: logi checker refactor
This commit is contained in:
committed by
Diflow
parent
eb24dd5d9e
commit
d07bf270e7
@@ -21,6 +21,7 @@ const {
|
|||||||
} = require('../utility/cloudIntf');
|
} = require('../utility/cloudIntf');
|
||||||
const socket = require('../utility/socket');
|
const socket = require('../utility/socket');
|
||||||
const { sendToAuditLog } = require('../utility/auditlog');
|
const { sendToAuditLog } = require('../utility/auditlog');
|
||||||
|
const { isLoginLicensed, LOGIN_LIMIT_ERROR } = require('../utility/loginchecker');
|
||||||
|
|
||||||
const logger = getLogger('auth');
|
const logger = getLogger('auth');
|
||||||
|
|
||||||
@@ -110,6 +111,10 @@ module.exports = {
|
|||||||
adminPassword = decryptPasswordString(adminConfig?.adminPassword);
|
adminPassword = decryptPasswordString(adminConfig?.adminPassword);
|
||||||
}
|
}
|
||||||
if (adminPassword && adminPassword == password) {
|
if (adminPassword && adminPassword == password) {
|
||||||
|
if (!(await isLoginLicensed(req, `superadmin`))) {
|
||||||
|
return { error: LOGIN_LIMIT_ERROR };
|
||||||
|
}
|
||||||
|
|
||||||
sendToAuditLog(req, {
|
sendToAuditLog(req, {
|
||||||
category: 'auth',
|
category: 'auth',
|
||||||
component: 'AuthController',
|
component: 'AuthController',
|
||||||
|
|||||||
Reference in New Issue
Block a user