mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
Fix that logout of unauthenticated users throws exceptions
This commit is contained in:
parent
ebde422824
commit
266936b9b5
@ -142,14 +142,16 @@ class AuthenticationController extends ActionController
|
||||
public function logoutAction()
|
||||
{
|
||||
$auth = $this->Auth();
|
||||
if (! $auth->isAuthenticated()) {
|
||||
$this->redirectToLogin();
|
||||
}
|
||||
$isRemoteUser = $auth->getUser()->isRemoteUser();
|
||||
$auth->removeAuthorization();
|
||||
|
||||
if ($isRemoteUser === true) {
|
||||
$this->_helper->layout->setLayout('login');
|
||||
$this->_response->setHttpResponseCode(401);
|
||||
} else {
|
||||
$this->rerenderLayout()->redirectToLogin();
|
||||
$this->redirectToLogin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user