File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,16 @@ private function buildProtocolErrorResponse(?bool $throttle = null): TemplateRes
208208 * @return DataDisplayResponse|RedirectResponse|TemplateResponse
209209 */
210210 public function login (int $ providerId , string $ redirectUrl = null ) {
211+ // to be safe, avoid redirecting to logout or single-logout
212+ $ logoutUrl = $ this ->urlGenerator ->linkToRoute ('core.login.logout ' );
213+ $ userOidcLogoutUrl = $ this ->urlGenerator ->linkToRoute (Application::APP_ID . '.login.singleLogoutService ' );
214+ if (
215+ $ redirectUrl
216+ && (strpos ($ redirectUrl , $ logoutUrl ) !== false || strpos ($ redirectUrl , $ userOidcLogoutUrl ) !== false )
217+ ) {
218+ $ redirectUrl = $ this ->urlGenerator ->getBaseUrl ();
219+ }
220+
211221 if ($ this ->userSession ->isLoggedIn ()) {
212222 return new RedirectResponse ($ redirectUrl );
213223 }
You can’t perform that action at this time.
0 commit comments