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