Skip to content

Commit

Permalink
Merge pull request #34057 from nextcloud/bugfix/noid/fix-2fa-provider…
Browse files Browse the repository at this point in the history
…s-dark-mode

Fix twofactor provider icons in dark mode
  • Loading branch information
szaimen authored Sep 13, 2022
2 parents b739dd5 + 7d6d656 commit 4baa09d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion apps/settings/lib/Settings/Personal/Security/TwoFactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public function __construct(ProviderLoader $providerLoader,
public function getForm(): TemplateResponse {
return new TemplateResponse('settings', 'settings/personal/security/twofactor', [
'twoFactorProviderData' => $this->getTwoFactorProviderData(),
'themedark' => $this->config->getUserValue($this->uid, 'accessibility', 'theme', false)
]);
}

Expand Down
12 changes: 2 additions & 10 deletions apps/settings/templates/settings/personal/security/twofactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,10 @@
$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'];
Expand Down

0 comments on commit 4baa09d

Please sign in to comment.