mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-29 17:26:40 +01:00
Fixed error message when user clicks logout link after his session has been expired
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
1. [](#bugfix)
|
1. [](#bugfix)
|
||||||
* Fixed `You have been logged out` message when entering to 2FA authentication due to `/admin/task:getNotifications` AJAX call
|
* Fixed `You have been logged out` message when entering to 2FA authentication due to `/admin/task:getNotifications` AJAX call
|
||||||
* Fixed broken 2FA login when site is not configured to use Flex Users [#2109](https://github.com/getgrav/grav-plugin-admin/issues/2109)
|
* Fixed broken 2FA login when site is not configured to use Flex Users [#2109](https://github.com/getgrav/grav-plugin-admin/issues/2109)
|
||||||
|
* Fixed error message when user clicks logout link after his session has been expired
|
||||||
|
|
||||||
# v1.10.10
|
# v1.10.10
|
||||||
## 04/07/2021
|
## 04/07/2021
|
||||||
|
|||||||
@@ -210,20 +210,14 @@ class LoginController extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle logout when user isn't fully logged in.
|
* Handle logout when user isn't fully logged in or clicks logout after the session has been expired.
|
||||||
*
|
*
|
||||||
* @return ResponseInterface
|
* @return ResponseInterface
|
||||||
*/
|
*/
|
||||||
public function taskLogout(): ResponseInterface
|
public function taskLogout(): ResponseInterface
|
||||||
{
|
{
|
||||||
try {
|
// We do not need to check the nonce here as user session has been expired or user hasn't fully logged in (2FA).
|
||||||
$this->checkNonce();
|
// Just be sure we terminate the current session.
|
||||||
} catch (PageExpiredException $e) {
|
|
||||||
$this->setMessage($this->translate('PLUGIN_ADMIN.INVALID_SECURITY_TOKEN'), 'error');
|
|
||||||
|
|
||||||
return $this->createDisplayResponse();
|
|
||||||
}
|
|
||||||
|
|
||||||
$login = $this->getLogin();
|
$login = $this->getLogin();
|
||||||
$event = $login->logout(['admin' => true], ['return_event' => true]);
|
$event = $login->logout(['admin' => true], ['return_event' => true]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user