CompleteLoginCommand.php 707 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Authentication\Login;
  8. use OC\User\Session;
  9. class CompleteLoginCommand extends ALoginCommand {
  10. /** @var Session */
  11. private $userSession;
  12. public function __construct(Session $userSession) {
  13. $this->userSession = $userSession;
  14. }
  15. public function process(LoginData $loginData): LoginResult {
  16. $this->userSession->completeLogin(
  17. $loginData->getUser(),
  18. [
  19. 'loginName' => $loginData->getUsername(),
  20. 'password' => $loginData->getPassword(),
  21. ]
  22. );
  23. return $this->processNextOrFinishSuccessfully($loginData);
  24. }
  25. }