/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/src/Controller/Traits
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakedc/users/src/Controller/Traits/LoginTrait.php (2226B)
handleLogin(false, true);
}
/**
* Login user
*
* @return mixed
* @throws \Exception
*/
public function login()
{
$this->getRequest()->getSession()->delete(AuthenticationService::TWO_FACTOR_VERIFY_SESSION_KEY);
$Login = LoginComponentLoader::forForm($this);
return $Login->handleLogin(true, false);
}
/**
* Logout
*
* @return mixed
*/
public function logout()
{
$user = $this->getRequest()->getAttribute('identity');
$user = $user ?? [];
$eventBefore = $this->dispatchEvent(Plugin::EVENT_BEFORE_LOGOUT, ['user' => $user]);
if (is_array($eventBefore->getResult())) {
return $this->redirect($eventBefore->getResult());
}
$this->getRequest()->getSession()->destroy();
$this->Flash->success(__d('cake_d_c/users', 'You\'ve successfully logged out'));
$eventAfter = $this->dispatchEvent(Plugin::EVENT_AFTER_LOGOUT, ['user' => $user]);
if (is_array($eventAfter->getResult())) {
return $this->redirect($eventAfter->getResult());
}
return $this->redirect($this->Authentication->logout());
}
}