diff --git a/lib/api/auth.js b/lib/api/auth.js index c084b8e8..6f5017b6 100644 --- a/lib/api/auth.js +++ b/lib/api/auth.js @@ -359,7 +359,7 @@ module.exports = (db, server, userHandler) => { filter.ip = ip; } - let total = await db.database.collection('authlog').countDocuments(filter); + let total = await db.users.collection('authlog').countDocuments(filter); let opts = { limit, @@ -535,7 +535,7 @@ module.exports = (db, server, userHandler) => { let filter = { _id: event, user }; let eventData; try { - eventData = await db.database.collection('authlog').findOne(filter); + eventData = await db.users.collection('authlog').findOne(filter); } catch (err) { res.json({ error: 'MongoDB Error: ' + err.message,