notification: do not send login notification for external users

This commit is contained in:
Girish Ramakrishnan
2024-06-13 16:47:08 +02:00
parent 6b4df0bd65
commit 649c06b641
4 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ async function login(req, res, next) {
const auditSource = AuditSource.fromRequest(req);
await eventlog.add(req.user.ghost ? eventlog.ACTION_USER_LOGIN_GHOST : eventlog.ACTION_USER_LOGIN, auditSource, { userId: req.user.id, user: users.removePrivateFields(req.user), type, appId: tokens.ID_CLI });
if (!req.user.ghost) safe(users.notifyLoginLocation(req.user, ip, userAgent, auditSource), { debug });
await safe(users.notifyLoginLocation(req.user, ip, userAgent, auditSource), { debug });
next(new HttpSuccess(200, token));
}