diff --git a/lib/private/Settings/Personal/Security.php b/lib/private/Settings/Personal/Security.php
index eee1d9ae084bb69e05c5b76370184913dbba6abc..a009c6a12f491a4c376b0a6704c968cc52866330 100644
--- a/lib/private/Settings/Personal/Security.php
+++ b/lib/private/Settings/Personal/Security.php
@@ -42,6 +42,7 @@ use OCP\IUserManager;
 use OCP\IUserSession;
 use OCP\Session\Exceptions\SessionNotAvailableException;
 use OCP\Settings\ISettings;
+use OCP\IConfig;
 
 class Security implements ISettings {
 
@@ -69,6 +70,10 @@ class Security implements ISettings {
 	 * @var string|null
 	 */
 	private $uid;
+	/**
+	 *@var IConfig
+	 */
+	private $config;
 
 	public function __construct(IUserManager $userManager,
 								TwoFactorManager $providerManager,
@@ -76,6 +81,7 @@ class Security implements ISettings {
 								ProviderLoader $providerLoader,
 								IUserSession $userSession,
 								ISession $session,
+								IConfig $config,
 								IInitialStateService $initialStateService,
 								?string $UserId) {
 		$this->userManager = $userManager;
@@ -86,6 +92,7 @@ class Security implements ISettings {
 		$this->session = $session;
 		$this->initialStateService = $initialStateService;
 		$this->uid = $UserId;
+		$this->config = $config;
 	}
 
 	/**
@@ -108,6 +115,7 @@ class Security implements ISettings {
 		return new TemplateResponse('settings', 'settings/personal/security', [
 			'passwordChangeSupported' => $passwordChangeSupported,
 			'twoFactorProviderData' => $this->getTwoFactorProviderData(),
+			'themedark' => $this->config->getUserValue($this->uid, 'accessibility', 'theme', false)
 		]);
 	}
 
diff --git a/settings/templates/settings/personal/security.php b/settings/templates/settings/personal/security.php
index b7983b7c5d919155fce01115009b9fd542e4cfb5..6cd8ae735beaaa97572eaf536237595f27f4d1b3 100644
--- a/settings/templates/settings/personal/security.php
+++ b/settings/templates/settings/personal/security.php
@@ -69,12 +69,26 @@ if($_['passwordChangeSupported']) {
 	<?php foreach ($_['twoFactorProviderData']['providers'] as $data) { ?>
 		<li>
 			<?php
+
 			/** @var \OCP\Authentication\TwoFactorAuth\IProvidesPersonalSettings $provider */
 			$provider = $data['provider'];
+			//Handle 2FA provider icons and theme
 			if ($provider instanceof \OCP\Authentication\TwoFactorAuth\IProvidesIcons) {
-				$icon = $provider->getDarkIcon();
+				if ($_['themedark']) {
+					$icon = $provider->getLightIcon();
+				}
+				else {
+					$icon = $provider->getDarkIcon();
+				}
+				//fallback icon if the 2factor provider doesn't provide an icon.
 			} else {
-				$icon = image_path('core', 'actions/password.svg');
+				if ($_['themedark']) {
+					$icon = image_path('core', 'actions/password-white.svg');
+				}
+				else {
+					$icon = image_path('core', 'actions/password.svg');
+				}
+
 			}
 			/** @var \OCP\Authentication\TwoFactorAuth\IPersonalProviderSettings $settings */
 			$settings = $data['settings'];