fdnjhbpfwbz
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user