Merge pull request #34057 from nextcloud/bugfix/noid/fix-2fa-providers-dark-mode

Fix twofactor provider icons in dark mode
This commit is contained in:
Simon L 2022-09-13 20:04:00 +02:00 committed by GitHub
commit 4baa09d56b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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'];