Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

delegate check for 'receive login notification' to the sendTelegramNotification

Blue Mousefbbf51eb178e
diff --git a/apps/production/src/auth/auth.controller.ts b/apps/production/src/auth/auth.controller.ts
index 12aa18e7c..63ea66f77 100644
--- a/apps/production/src/auth/auth.controller.ts
+++ b/apps/production/src/auth/auth.controller.ts
@@ -151,9 +151,7 @@ export class AuthController {
!user.isTwoFactorAuthenticationEnabled,
)
- if (user.isReceiveLoginAlerts) {
- await this.authService.sendTelegramNotification(user.id, headers, ip)
- }
+ await this.authService.sendTelegramNotification(user.id, headers, ip)
if (user.isTwoFactorAuthenticationEnabled) {
user = _pick(user, ['isTwoFactorAuthenticationEnabled', 'email'])
diff --git a/apps/production/src/auth/auth.service.ts b/apps/production/src/auth/auth.service.ts
index acb1a4fc8..7fc2534df 100644
--- a/apps/production/src/auth/auth.service.ts
+++ b/apps/production/src/auth/auth.service.ts
@@ -223,7 +223,7 @@ export class AuthService {
) {
const user = await this.userService.findUserById(userId)
- if (!user.telegramChatId) {
+ if (!user.telegramChatId || !user.isReceiveLoginAlerts) {
return
}