From 5bab7d4912d917a12016ad780ac3e975af123a3b Mon Sep 17 00:00:00 2001
From: Bubka <858858+Bubka@users.noreply.github.com>
Date: Thu, 21 Jul 2022 19:07:53 +0200
Subject: [PATCH] Add a user option to disable Official icons fetching
---
app/Models/TwoFAccount.php | 2 +-
config/2fauth.php | 1 +
resources/js/views/settings/Options.vue | 4 ++++
resources/js/views/twofaccounts/Create.vue | 27 +++++++++++-----------
resources/js/views/twofaccounts/Edit.vue | 25 ++++++++++----------
resources/lang/en/settings.php | 4 ++++
6 files changed, 37 insertions(+), 26 deletions(-)
diff --git a/app/Models/TwoFAccount.php b/app/Models/TwoFAccount.php
index 15689f0c..3e645ec4 100644
--- a/app/Models/TwoFAccount.php
+++ b/app/Models/TwoFAccount.php
@@ -588,7 +588,7 @@ private function getDefaultIcon()
{
$logoService = App::make(LogoService::class);
- return $logoService->getIcon($this->service);
+ return SettingService::get('getOfficialIcons') ? $logoService->getIcon($this->service) : null;
}
diff --git a/config/2fauth.php b/config/2fauth.php
index ed66ca18..77f80d2a 100644
--- a/config/2fauth.php
+++ b/config/2fauth.php
@@ -60,6 +60,7 @@
'useDirectCapture' => false,
'useWebauthnAsDefault' => false,
'useWebauthnOnly' => false,
+ 'getOfficialIcons' => true,
],
];
\ No newline at end of file
diff --git a/resources/js/views/settings/Options.vue b/resources/js/views/settings/Options.vue
index cfe0fa53..a6a0289a 100644
--- a/resources/js/views/settings/Options.vue
+++ b/resources/js/views/settings/Options.vue
@@ -13,6 +13,9 @@