Skip to content

Commit

Permalink
fix sso redirect when redirectUrl is null
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Jan 16, 2024
1 parent 7c90c0d commit dd9d580
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ private function registerRedirect(IRequest $request, IURLGenerator $urlGenerator
// if the login page's redirect_url GET param is the logout page, just use the base URL instead
$logoutUrl = $urlGenerator->linkToRoute('core.login.logout');
$userOidcLogoutUrl = $urlGenerator->linkToRoute(self::APP_ID . '.login.singleLogoutService');
if (strpos($redirectUrl, $logoutUrl) !== false || strpos($redirectUrl, $userOidcLogoutUrl) !== false) {
if (
$redirectUrl
&& (strpos($redirectUrl, $logoutUrl) !== false || strpos($redirectUrl, $userOidcLogoutUrl) !== false)
) {
$redirectUrl = $urlGenerator->getBaseUrl();
}
$targetUrl = $urlGenerator->linkToRoute(self::APP_ID . '.login.login', [
Expand Down

0 comments on commit dd9d580

Please sign in to comment.