aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication/Login/UpdateLastPasswordConfirmCommand.php
blob: 0582239e9de33c7972d0c31b52df030594977b0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OC\Authentication\Login;

use OCP\ISession;

class UpdateLastPasswordConfirmCommand extends ALoginCommand {
	/** @var ISession */
	private $session;

	public function __construct(ISession $session) {
		$this->session = $session;
	}

	public function process(LoginData $loginData): LoginResult {
		$this->session->set(
			'last-password-confirm',
			$loginData->getUser()->getLastLogin()
		);

		return $this->processNextOrFinishSuccessfully($loginData);
	}
}