aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-04-02 00:06:10 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2025-04-02 00:06:10 +0200
commita3c2600386f92e718127f5874edaebfa7b7a4e87 (patch)
tree87ca2170593a10f2702c99fcc9fdca6f28c51ae5 /apps
parentfdc0b1ecf423e400257edf868a51d5873fc66c64 (diff)
downloadnextcloud-server-a3c2600386f92e718127f5874edaebfa7b7a4e87.tar.gz
nextcloud-server-a3c2600386f92e718127f5874edaebfa7b7a4e87.zip
fix(encryption): init keys also when logged in using cookie authfix/user-login-with-cookie-e2ee
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps')
-rw-r--r--apps/encryption/lib/AppInfo/Application.php2
-rw-r--r--apps/encryption/lib/Listeners/UserEventsListener.php5
2 files changed, 5 insertions, 2 deletions
diff --git a/apps/encryption/lib/AppInfo/Application.php b/apps/encryption/lib/AppInfo/Application.php
index f2ffa34535e..a4e9426c3e5 100644
--- a/apps/encryption/lib/AppInfo/Application.php
+++ b/apps/encryption/lib/AppInfo/Application.php
@@ -32,6 +32,7 @@ use OCP\User\Events\PasswordUpdatedEvent;
use OCP\User\Events\UserCreatedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\User\Events\UserLoggedInEvent;
+use OCP\User\Events\UserLoggedInWithCookieEvent;
use OCP\User\Events\UserLoggedOutEvent;
use Psr\Log\LoggerInterface;
@@ -90,6 +91,7 @@ class Application extends App implements IBootstrap {
$eventDispatcher->addServiceListener(BeforePasswordResetEvent::class, UserEventsListener::class);
$eventDispatcher->addServiceListener(PasswordResetEvent::class, UserEventsListener::class);
$eventDispatcher->addServiceListener(UserLoggedInEvent::class, UserEventsListener::class);
+ $eventDispatcher->addServiceListener(UserLoggedInWithCookieEvent::class, UserEventsListener::class);
$eventDispatcher->addServiceListener(UserLoggedOutEvent::class, UserEventsListener::class);
}
diff --git a/apps/encryption/lib/Listeners/UserEventsListener.php b/apps/encryption/lib/Listeners/UserEventsListener.php
index 694640a0103..3f61fde599b 100644
--- a/apps/encryption/lib/Listeners/UserEventsListener.php
+++ b/apps/encryption/lib/Listeners/UserEventsListener.php
@@ -26,10 +26,11 @@ use OCP\User\Events\PasswordUpdatedEvent;
use OCP\User\Events\UserCreatedEvent;
use OCP\User\Events\UserDeletedEvent;
use OCP\User\Events\UserLoggedInEvent;
+use OCP\User\Events\UserLoggedInWithCookieEvent;
use OCP\User\Events\UserLoggedOutEvent;
/**
- * @template-implements IEventListener<UserCreatedEvent|UserDeletedEvent|UserLoggedInEvent|UserLoggedOutEvent|BeforePasswordUpdatedEvent|PasswordUpdatedEvent|BeforePasswordResetEvent|PasswordResetEvent>
+ * @template-implements IEventListener<UserCreatedEvent|UserDeletedEvent|UserLoggedInEvent|UserLoggedInWithCookieEvent|UserLoggedOutEvent|BeforePasswordUpdatedEvent|PasswordUpdatedEvent|BeforePasswordResetEvent|PasswordResetEvent>
*/
class UserEventsListener implements IEventListener {
@@ -50,7 +51,7 @@ class UserEventsListener implements IEventListener {
$this->onUserCreated($event->getUid(), $event->getPassword());
} elseif ($event instanceof UserDeletedEvent) {
$this->onUserDeleted($event->getUid());
- } elseif ($event instanceof UserLoggedInEvent) {
+ } elseif ($event instanceof UserLoggedInEvent || $event instanceof UserLoggedInWithCookieEvent) {
$this->onUserLogin($event->getUser(), $event->getPassword());
} elseif ($event instanceof UserLoggedOutEvent) {
$this->onUserLogout();