Skip to content

Commit

Permalink
Remove unused parameter (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackcoder87 authored Dec 4, 2024
1 parent e87de9d commit 4caeb7f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application/modules/user/controllers/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function indexAction()
$userMapper = new UserMapper();
$userMapper->deleteselectsdelete(($this->getConfig()->get('userdeletetime')));

$result = LoginService::factory()->perform($this->getRequest()->getPost('login_emailname'), $this->getRequest()->getPost('login_password'), (bool)$this->getRequest()->getPost('rememberMe', 0));
$result = LoginService::factory()->perform($this->getRequest()->getPost('login_emailname'), $this->getRequest()->getPost('login_password'));

if ($result->isSuccessful()) {
$cookieStolenMapper = new CookieStolenMapper();
Expand Down
5 changes: 3 additions & 2 deletions application/modules/user/service/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace Modules\User\Service;

use Ilch\Database\Exception;
use Modules\User\Mappers\User as UserMapper;
use Modules\User\Service\Login\Result as LoginResult;

Expand Down Expand Up @@ -45,10 +46,10 @@ public function __construct(UserMapper $mapper, Password $passwordService)
* Performs the Login for a User
* @param string $userNameOrEmail
* @param string $password
* @param bool $remember
* @return LoginResult
* @throws Exception
*/
public function perform(string $userNameOrEmail, string $password, bool $remember = false): LoginResult
public function perform(string $userNameOrEmail, string $password): LoginResult
{
$user = $this->mapper->getUserByEmail($userNameOrEmail);

Expand Down
6 changes: 3 additions & 3 deletions application/modules/user/service/Remember.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Remember
* @throws \Exception
* @since 2.1.38
*/
public function rememberMe($userId)
public function rememberMe(int $userId)
{
$authTokenModel = new AuthTokenModel();

Expand All @@ -36,7 +36,7 @@ public function rememberMe($userId)
$authTokenModel->setUserid($userId);
$authTokenModel->setExpires(date('Y-m-d\TH:i:s', strtotime('+30 days')));

setcookieIlch('remember', $authTokenModel->getSelector().':'.base64_encode($authenticator), strtotime('+30 days'));
setcookieIlch('remember', $authTokenModel->getSelector() . ':' . base64_encode($authenticator), strtotime('+30 days'));

$authTokenMapper = new AuthTokenMapper();
$authTokenMapper->addAuthToken($authTokenModel);
Expand Down Expand Up @@ -74,7 +74,7 @@ public function reauthenticate()
$authTokenModel->setUserid($_SESSION['user_id']);
$authTokenModel->setExpires(date('Y-m-d\TH:i:s', strtotime('+30 days')));

setcookieIlch('remember', $authTokenModel->getSelector().':'.base64_encode($authenticator), strtotime('+30 days'));
setcookieIlch('remember', $authTokenModel->getSelector() . ':' . base64_encode($authenticator), strtotime('+30 days'));

$authTokenMapper->updateAuthToken($authTokenModel);
} else {
Expand Down

0 comments on commit 4caeb7f

Please sign in to comment.