LoginFailedEvent.php 725 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Authentication\Events;
  8. use OCP\EventDispatcher\Event;
  9. /**
  10. * Emitted when the authentication fails, but only if the login name can be associated with an existing user.
  11. *
  12. * @since 19.0.0
  13. */
  14. class LoginFailedEvent extends Event {
  15. /** @var string */
  16. private $uid;
  17. /**
  18. * @since 19.0.0
  19. */
  20. public function __construct(string $uid) {
  21. parent::__construct();
  22. $this->uid = $uid;
  23. }
  24. /**
  25. * returns the uid of the user that was tried to login against
  26. *
  27. * @since 19.0.0
  28. */
  29. public function getUid(): string {
  30. return $this->uid;
  31. }
  32. }