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);
$request->getSession()->invalidate();
return $this->redirect($this->generateUrl('app_home'));
return $this->redirectToRoute('app_home');
}
public function logoutCAS(Request $request)
@ -353,7 +353,7 @@ class SecurityController extends AbstractController
$this->tokenstorage->setToken(null);
$request->getSession()->invalidate();
return $this->redirect($this->generateUrl('app_home'));
return $this->redirectToRoute('app_home');
}
public function logoutOPENID(Request $request)
@ -370,11 +370,11 @@ class SecurityController extends AbstractController
$callback = $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL);
$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);
} else {
return $this->redirect($this->generateUrl('app_home'));
return $this->redirectToRoute('app_home');
}
}
@ -451,7 +451,7 @@ class SecurityController extends AbstractController
if ($redirect) {
return $this->redirect($redirect);
} else {
return $this->redirect($this->generateUrl('app_home'));
return $this->redirectToRoute('app_home');
}
}
}

View File

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