Fix twofactor provider icons in dark mode

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2022-09-13 17:28:40 +02:00
parent b739dd5807
commit 7d6d65600e
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205
2 changed files with 2 additions and 11 deletions

View file

@ -72,7 +72,6 @@ class TwoFactor implements ISettings {
public function getForm(): TemplateResponse {
return new TemplateResponse('settings', 'settings/personal/security/twofactor', [
'twoFactorProviderData' => $this->getTwoFactorProviderData(),
'themedark' => $this->config->getUserValue($this->uid, 'accessibility', 'theme', false)
]);
}

View file

@ -40,18 +40,10 @@ declare(strict_types=1);
$provider = $data['provider'];
//Handle 2FA provider icons and theme
if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
if ($_['themedark']) {
$icon = $provider->getLightIcon();
} else {
$icon = $provider->getDarkIcon();
}
$icon = $provider->getDarkIcon();
//fallback icon if the 2factor provider doesn't provide an icon.
} else {
if ($_['themedark']) {
$icon = image_path('core', 'actions/password-white.svg');
} else {
$icon = image_path('core', 'actions/password.svg');
}
$icon = image_path('core', 'actions/password.svg');
}
/** @var \OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings $settings */
$settings = $data['settings'];