fix(encryption): Do not load encryption js on login

This was breaking ephemeral sessions again.

Signed-off-by: Louis Chmn <louis@chmn.me>
artonge/fix/ephemeral_encryption
Louis Chmn 2 months ago
parent 99d6276826
commit 5b3876535c
  1. 13
      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)) {

Loading…
Cancel
Save