fdnjhbpfwbz

This commit is contained in:
2026-07-07 10:43:31 +05:00
parent 026d346d31
commit 5d54a7dba8
3 changed files with 77 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ const requireAuth = (req, res, next) => {
const loginAttempts = new Map();
app.post('/api/login', (req, res) => {
app.post('/api/login', async (req, res) => {
const ip = req.ip || req.connection.remoteAddress;
const now = Date.now();
if (loginAttempts.has(ip)) {
@@ -134,7 +134,10 @@ app.post('/api/login', (req, res) => {
}
try {
const user = authService.authenticate(login, password);
let user = authService.authenticateLocal(login, password);
if (!user) {
user = await authService.authenticateWithLDAP(login, password);
}
if (user) {
const sessionUser = {
id: user.id,