notification: do not send login notification for external users
This commit is contained in:
@@ -743,6 +743,7 @@ async function notifyLoginLocation(user, ip, userAgent, auditSource) {
|
||||
|
||||
if (constants.DEMO) return;
|
||||
if (constants.TEST && ip === '127.0.0.1') return;
|
||||
if (user.ghost || user.source) return; // for external users, rely on the external source to send login notification to avoid dup login emails
|
||||
|
||||
const response = await superagent.get('https://geolocation.cloudron.io/json').query({ ip }).ok(() => true);
|
||||
if (response.statusCode !== 200) return debug(`Failed to get geoip info. statusCode: ${response.statusCode}`);
|
||||
|
||||
Reference in New Issue
Block a user