redirect logout

This commit is contained in:
afornerot 2023-07-20 15:59:54 +02:00
parent 1be43b086c
commit bd06832205
2 changed files with 6 additions and 5 deletions

View File

@ -327,7 +327,7 @@ class SecurityController extends AbstractController
$this->tokenstorage->setToken(null); $this->tokenstorage->setToken(null);
$request->getSession()->invalidate(); $request->getSession()->invalidate();
return $this->redirect($this->generateUrl('app_home')); return $this->redirectToRoute('app_home');
} }
public function logoutCAS(Request $request) public function logoutCAS(Request $request)
@ -353,7 +353,7 @@ class SecurityController extends AbstractController
$this->tokenstorage->setToken(null); $this->tokenstorage->setToken(null);
$request->getSession()->invalidate(); $request->getSession()->invalidate();
return $this->redirect($this->generateUrl('app_home')); return $this->redirectToRoute('app_home');
} }
public function logoutOPENID(Request $request) public function logoutOPENID(Request $request)
@ -370,11 +370,11 @@ class SecurityController extends AbstractController
$callback = $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL); $callback = $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL);
$callback = substr($callback, 0, -1); $callback = substr($callback, 0, -1);
$url .= "?id_token_hint=$idtoken&scope=openid&post_logout_redirect_uri=$callback"; $url .= "?id_token_hint=$idtoken&scope=openid profile email&post_logout_redirect_uri=$callback";
return $this->redirect($url); return $this->redirect($url);
} else { } else {
return $this->redirect($this->generateUrl('app_home')); return $this->redirectToRoute('app_home');
} }
} }
@ -451,7 +451,7 @@ class SecurityController extends AbstractController
if ($redirect) { if ($redirect) {
return $this->redirect($redirect); return $this->redirect($redirect);
} else { } else {
return $this->redirect($this->generateUrl('app_home')); return $this->redirectToRoute('app_home');
} }
} }
} }

View File

@ -673,6 +673,7 @@ class LdapService
$connection = $this->connect(); $connection = $this->connect();
$res = ldap_search($connection, $this->basedn, str_replace('*', $username, $this->filteruser)); $res = ldap_search($connection, $this->basedn, str_replace('*', $username, $this->filteruser));
$first = ldap_first_entry($this->connection, $res); $first = ldap_first_entry($this->connection, $res);
if(!$first) return false;
$dn = ldap_get_dn($this->connection, $first); $dn = ldap_get_dn($this->connection, $first);
return $dn; return $dn;
} }