mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-10-28 08:46:45 +01:00
Logout is one step now
This commit is contained in:
@@ -691,10 +691,12 @@ class AdminController extends AdminBaseController
|
||||
*/
|
||||
protected function taskLogout()
|
||||
{
|
||||
$language = $this->grav['user']->authenticated ? $this->grav['user']->language : ($this->grav['language']->getLanguage() ?: 'en');
|
||||
$message = $this->admin->translate('PLUGIN_ADMIN.LOGGED_OUT');
|
||||
|
||||
$this->admin->session()->invalidate()->start();
|
||||
$this->setRedirect('/logout/lang:' . $language);
|
||||
$this->grav['session']->setFlashCookieObject(Admin::TMP_COOKIE_NAME, ['message' => $message, 'status' => 'info']);
|
||||
|
||||
$this->setRedirect('/');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user