diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index 64bec6de9be..0723e90173b 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -35,7 +35,9 @@ p($theme->getTitle());
-
+ data-themes="">
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 01d22edc0fb..ae7b1f47dca 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -149,6 +149,13 @@ class TemplateLayout {
if ($user) {
$userDisplayName = $user->getDisplayName();
}
+
+ $page->assign('enabledThemes', []);
+ if ($this->appManager->isEnabledForUser('theming') && class_exists('\OCA\Theming\Service\ThemesService')) {
+ $themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
+ $page->assign('enabledThemes', $themesService->getEnabledThemes());
+ }
+
$page->assign('user_displayname', $userDisplayName);
$page->assign('user_uid', \OC_User::getUser());
break;