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
+2 -2
View File
@@ -568,7 +568,7 @@ function interactionLogin(provider) {
const auditSource = AuditSource.fromOidcRequest(req);
await eventlog.add(user.ghost ? eventlog.ACTION_USER_LOGIN_GHOST : eventlog.ACTION_USER_LOGIN, auditSource, { userId: user.id, user: users.removePrivateFields(user), appId: clientId });
if (!user.ghost) safe(users.notifyLoginLocation(user, ip, userAgent, auditSource), { debug });
await safe(users.notifyLoginLocation(user, ip, userAgent, auditSource), { debug });
// clear token as it is one-time use
await tokens.delByAccessToken(req.body.autoLoginToken);
@@ -602,7 +602,7 @@ function interactionLogin(provider) {
const auditSource = AuditSource.fromOidcRequest(req);
await eventlog.add(user.ghost ? eventlog.ACTION_USER_LOGIN_GHOST : eventlog.ACTION_USER_LOGIN, auditSource, { userId: user.id, user: users.removePrivateFields(user), appId: clientId });
if (!user.ghost) safe(users.notifyLoginLocation(user, ip, userAgent, auditSource), { debug });
await safe(users.notifyLoginLocation(user, ip, userAgent, auditSource), { debug });
// debug(`route interaction login post result redirectTo:${redirectTo}`);