diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Server.php | 2 | ||||
-rw-r--r-- | lib/public/User/Events/UserLoggedInEvent.php | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php index 1114e60f475..ba954165799 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -575,7 +575,7 @@ class Server extends ServerContainer implements IServerContainer { /** @var IEventDispatcher $dispatcher */ $dispatcher = $this->get(IEventDispatcher::class); - $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $password, $isTokenLogin)); + $dispatcher->dispatchTyped(new UserLoggedInEvent($user, $loginName, $password, $isTokenLogin)); }); $userSession->listen('\OC\User', 'preRememberedLogin', function ($uid) { /** @var IEventDispatcher $dispatcher */ diff --git a/lib/public/User/Events/UserLoggedInEvent.php b/lib/public/User/Events/UserLoggedInEvent.php index e2cb37a64dc..7d0c0bf41de 100644 --- a/lib/public/User/Events/UserLoggedInEvent.php +++ b/lib/public/User/Events/UserLoggedInEvent.php @@ -43,14 +43,18 @@ class UserLoggedInEvent extends Event { /** @var bool */ private $isTokenLogin; + /** @var string */ + private $loginName; + /** * @since 18.0.0 */ - public function __construct(IUser $user, string $password, bool $isTokenLogin) { + public function __construct(IUser $user, string $loginName, string $password, bool $isTokenLogin) { parent::__construct(); $this->user = $user; $this->password = $password; $this->isTokenLogin = $isTokenLogin; + $this->loginName = $loginName; } /** @@ -61,6 +65,13 @@ class UserLoggedInEvent extends Event { } /** + * @since 21.0.0 + */ + public function getLoginName(): string { + return $this->loginName; + } + + /** * @since 18.0.0 */ public function getPassword(): string { |