diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-01-20 14:59:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 14:59:30 +0100 |
commit | 6129a851873287dde1f922b9d6f3aa4624a07133 (patch) | |
tree | ac2eeda3d47743daf5e7b4bcf3dec1c79a9eda75 /lib | |
parent | 2c9345a3c674c333e863c21ca249cb336c91fbff (diff) | |
parent | 1e35ece8e59ed31c0ae7a578aced99d257e97e67 (diff) | |
download | nextcloud-server-6129a851873287dde1f922b9d6f3aa4624a07133.tar.gz nextcloud-server-6129a851873287dde1f922b9d6f3aa4624a07133.zip |
Merge pull request #25224 from nextcloud/bugfix/24600/fix-saving-user-credentials
Update handling of user credentials
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 { |