From ec4234e2434bff8a44b00e14c148e6dbe191c339 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Sep 2023 10:19:46 +0200 Subject: [PATCH 1/2] fix: only send internal notifcations to enabled channels --- app/Notifications/Internal/GeneralNotification.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Notifications/Internal/GeneralNotification.php b/app/Notifications/Internal/GeneralNotification.php index 024175622..d00432ca9 100644 --- a/app/Notifications/Internal/GeneralNotification.php +++ b/app/Notifications/Internal/GeneralNotification.php @@ -19,7 +19,17 @@ class GeneralNotification extends Notification implements ShouldQueue public function via(object $notifiable): array { - return [TelegramChannel::class, DiscordChannel::class]; + $channels = []; + $isDiscordEnabled = data_get($notifiable, 'discord_enabled'); + $isTelegramEnabled = data_get($notifiable, 'telegram_enabled'); + + if ($isDiscordEnabled) { + $channels[] = DiscordChannel::class; + } + if ($isTelegramEnabled) { + $channels[] = TelegramChannel::class; + } + return $channels; } public function toDiscord(): string From dc4f41222751123a4d776d2b86206fb24b08e9ea Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Sep 2023 10:41:39 +0200 Subject: [PATCH 2/2] fix: recovery code --- resources/views/auth/two-factor-challenge.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/auth/two-factor-challenge.blade.php b/resources/views/auth/two-factor-challenge.blade.php index d4abc66b0..90d975f22 100644 --- a/resources/views/auth/two-factor-challenge.blade.php +++ b/resources/views/auth/two-factor-challenge.blade.php @@ -20,7 +20,7 @@