diff --git a/core/AppInfo/Application.php b/core/AppInfo/Application.php index 08e1ff95a3dc7..61bcdfa1b7092 100644 --- a/core/AppInfo/Application.php +++ b/core/AppInfo/Application.php @@ -99,5 +99,4 @@ public function register(IRegistrationContext $context): void { public function boot(IBootContext $context): void { // ... } - } diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index b3733b1e26896..cf244b34959ba 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -282,17 +282,15 @@ private function init(bool $resolveClosures = true): void { } $logoutUrl = \OC_User::getLogoutUrl($this->urlGenerator); - if ($logoutUrl !== '') { - // Logout - $this->add([ - 'type' => 'settings', - 'id' => 'logout', - 'order' => 99999, - 'href' => $logoutUrl, - 'name' => $l->t('Log out'), - 'icon' => $this->urlGenerator->imagePath('core', 'actions/logout.svg'), - ]); - } + // Logout + $this->add([ + 'type' => 'settings', + 'id' => 'logout', + 'order' => 99999, + 'href' => $logoutUrl, + 'name' => $l->t('Log out'), + 'icon' => $this->urlGenerator->imagePath('core', 'actions/logout.svg'), + ]); if ($this->isSubadmin()) { // User management diff --git a/lib/private/legacy/OC_User.php b/lib/private/legacy/OC_User.php index f8355f1d0175a..6375afd3ab391 100644 --- a/lib/private/legacy/OC_User.php +++ b/lib/private/legacy/OC_User.php @@ -277,6 +277,7 @@ public static function isIncognitoMode(): bool { /** * Returns the current logout URL valid for the currently logged-in user + * @return non-empty-string */ public static function getLogoutUrl(IURLGenerator $urlGenerator): string { $backend = self::findFirstActiveUsedBackend(); @@ -288,7 +289,10 @@ public static function getLogoutUrl(IURLGenerator $urlGenerator): string { if ($user instanceof IUser) { $backend = $user->getBackend(); if ($backend instanceof ICustomLogout) { - return $backend->getLogoutUrl(); + $logoutUrl = $backend->getLogoutUrl(); + if ($logoutUrl !== '') { + return $logoutUrl; + } } } diff --git a/lib/public/Authentication/IApacheBackend.php b/lib/public/Authentication/IApacheBackend.php index 1e6b7bafa47b9..375da38ba0671 100644 --- a/lib/public/Authentication/IApacheBackend.php +++ b/lib/public/Authentication/IApacheBackend.php @@ -27,7 +27,7 @@ public function isSessionActive(); /** * Gets the current logout URL * - * @return string + * @return non-empty-string * @since 12.0.3 */ public function getLogoutUrl();