diff --git a/app/Api/v1/Controllers/TwoFAccountController.php b/app/Api/v1/Controllers/TwoFAccountController.php index a14286a3..806195f7 100644 --- a/app/Api/v1/Controllers/TwoFAccountController.php +++ b/app/Api/v1/Controllers/TwoFAccountController.php @@ -106,7 +106,7 @@ public function update(TwoFAccountUpdateRequest $request, TwoFAccount $twofaccou $this->authorize('update', $twofaccount); $validated = $request->validated(); - + $twofaccount->fillWithOtpParameters($validated, $twofaccount->icon && is_null(Arr::get($validated, 'icon', null))); $request->user()->twofaccounts()->save($twofaccount); diff --git a/app/Services/IconStoreService.php b/app/Services/IconStoreService.php index 520be581..fa85f236 100644 --- a/app/Services/IconStoreService.php +++ b/app/Services/IconStoreService.php @@ -32,9 +32,6 @@ class IconStoreService */ protected Sanitizer $svgSanitizer; - /** - * - */ public function __construct(Sanitizer $svgSanitizer) { $this->usesDatabase = Settings::get('storeIconsInDatabase'); diff --git a/app/Services/LogoService.php b/app/Services/LogoService.php index 27dce361..a08fe2c8 100644 --- a/app/Services/LogoService.php +++ b/app/Services/LogoService.php @@ -30,9 +30,6 @@ class LogoService */ const TFA_IMG_URL = 'https://raw.githubusercontent.com/2factorauth/twofactorauth/master/img/'; - /** - * - */ public function __construct() { $this->setTfaCollection(); diff --git a/tests/Api/v1/Controllers/TwoFAccountControllerTest.php b/tests/Api/v1/Controllers/TwoFAccountControllerTest.php index deff6c28..dabd463e 100644 --- a/tests/Api/v1/Controllers/TwoFAccountControllerTest.php +++ b/tests/Api/v1/Controllers/TwoFAccountControllerTest.php @@ -829,12 +829,12 @@ public function test_update_with_removed_icon_prevents_official_logo_fetching() 'legacy_uri' => OtpTestData::TOTP_SHORT_URI, 'icon' => 'icon.png', ]); - $twofaccount = TwoFAccount::factory()->for($this->user)->create($attributes); + $twofaccount = TwoFAccount::factory()->for($this->user)->create($attributes); $attributes['icon'] = ''; $response = $this->actingAs($this->user, 'api-guard') ->json('PUT', '/api/v1/twofaccounts/' . $twofaccount->id, $attributes); - + $this->assertNull($response->json('icon')); } diff --git a/tests/Feature/Services/IconServiceTest.php b/tests/Feature/Services/IconServiceTest.php index d05cdf14..4142b7c7 100644 --- a/tests/Feature/Services/IconServiceTest.php +++ b/tests/Feature/Services/IconServiceTest.php @@ -26,9 +26,6 @@ class IconServiceTest extends FeatureTestCase { use WithoutMiddleware; - /** - * - */ protected IconService $iconService; public function setUp() : void