Example #1
0
 /**
  * Logout and clear the identity
  */
 public function logoutAction()
 {
     $this->zfcUserAuthentication()->getAuthAdapter()->resetAdapters();
     $this->zfcUserAuthentication()->getAuthAdapter()->logoutAdapters();
     $this->zfcUserAuthentication()->getAuthService()->clearIdentity();
     $redirect = $this->params()->fromPost('redirect', $this->params()->fromQuery('redirect', false));
     if ($this->options->getUseRedirectParameterIfPresent() && $redirect) {
         return $this->redirect()->toRoute($redirect);
     }
     return $this->redirect()->toRoute($this->options->getLogoutRedirectRoute());
 }