From 5b3876535c5d471ecccb4c45bbbfdd467c644dbb Mon Sep 17 00:00:00 2001 From: Louis Chmn Date: Thu, 30 Oct 2025 14:30:38 +0100 Subject: [PATCH] fix(encryption): Do not load encryption js on login This was breaking ephemeral sessions again. Signed-off-by: Louis Chmn --- apps/encryption/lib/AppInfo/Application.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/encryption/lib/AppInfo/Application.php b/apps/encryption/lib/AppInfo/Application.php index b1bf93b9dea..17464e5e8e9 100644 --- a/apps/encryption/lib/AppInfo/Application.php +++ b/apps/encryption/lib/AppInfo/Application.php @@ -7,6 +7,7 @@ */ namespace OCA\Encryption\AppInfo; +use OC\Core\Controller\ClientFlowLoginV2Controller; use OC\Core\Events\BeforePasswordResetEvent; use OC\Core\Events\PasswordResetEvent; use OCA\Encryption\Crypto\Crypt; @@ -26,6 +27,9 @@ use OCP\Encryption\IManager; use OCP\EventDispatcher\IEventDispatcher; use OCP\IConfig; use OCP\IL10N; +use OCP\IRequest; +use OCP\ISession; +use OCP\IURLGenerator; use OCP\IUserSession; use OCP\User\Events\BeforePasswordUpdatedEvent; use OCP\User\Events\PasswordUpdatedEvent; @@ -47,7 +51,14 @@ class Application extends App implements IBootstrap { } public function boot(IBootContext $context): void { - \OCP\Util::addScript(self::APP_ID, 'encryption'); + $context->injectFn(function (IRequest $request, IURLGenerator $urlGenerator): void { + $webroot = $urlGenerator->getWebroot(); + if (str_starts_with($request->getPathInfo(), $webroot . '/login')) { + return; + } + + \OCP\Util::addScript(self::APP_ID, 'encryption'); + }); $context->injectFn(function (IManager $encryptionManager) use ($context): void { if (!($encryptionManager instanceof \OC\Encryption\Manager)) {