From 099224a383fe7652a5e64c37319622a9e19a6f62 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 3 Sep 2026 17:52:26 -0100 Subject: [PATCH] fix(refactor): allow logout Signed-off-by: Maxence Lange --- lib/AppInfo/Application.php | 10 +++++++++- lib/ConfigLexicon.php | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 127fada..b425bc1 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -11,6 +11,7 @@ use Exception; use OC; +use OCA\GlobalSiteSelector\ConfigLexicon; use OCA\GlobalSiteSelector\GlobalSiteSelector; use OCA\GlobalSiteSelector\Listeners\AddContentSecurityPolicyListener; use OCA\GlobalSiteSelector\Listeners\DeletingUser; @@ -83,6 +84,7 @@ public function register(IRegistrationContext $context): void { $context->registerEventListener(UserUpdatedEvent::class, UserChanged::class); $context->registerSetupCheck(LongJwtKeySetupCheck::class); + $context->registerConfigLexicon(ConfigLexicon::class); // registerGlobalScaleService() and IGlobalScaleService only exist since Nextcloud // 34.0.3, but this app still supports 32 and 33, see lib/Service/GlobalScaleService.php @@ -203,7 +205,13 @@ private function redirectToSlave(IRequest $request, Master $master, IUserSession // We should ignore oauth2 token endpoint (oauth can send the credentials as basic auth which will fail with apache auth) $uri = $request->getPathInfo(); - if (str_starts_with($uri, '/apps/oauth/api/v1/token') || str_starts_with($uri, '/apps/oauth2/authorize') || str_starts_with($uri, '/login/flow')) { + if (str_starts_with($uri, '/apps/oauth/api/v1/token') + || str_starts_with($uri, '/apps/oauth2/authorize') + || str_starts_with($uri, '/apps/globalsiteselector/autologout') + || str_starts_with($uri, '/apps/user_saml/saml/sls') + || str_starts_with($uri, '/apps/user_oidc/sls') + || str_starts_with($uri, '/login/flow') + ) { return; } diff --git a/lib/ConfigLexicon.php b/lib/ConfigLexicon.php index fb23998..bf69f1d 100644 --- a/lib/ConfigLexicon.php +++ b/lib/ConfigLexicon.php @@ -32,7 +32,7 @@ public function getStrictness(): Strictness { public function getAppConfigs(): array { return [ new Entry(key: self::GS_TOKENS, type: ValueType::ARRAY, defaultRaw: [], definition: 'list of token+host to navigate through GlobalScale', lazy: true), - new Entry(key: self::LOCAL_TOKEN, type: ValueType::STRING, defaultRaw: '', definition: 'local token to id instance within GlobalScale', lazy: true), + new Entry(key: self::LOCAL_TOKEN, type: ValueType::STRING, defaultRaw: '', definition: 'local token to id instance within GlobalScale'), new Entry(key: self::REDIRECT_WEBDAV, type: ValueType::BOOL, defaultRaw: false, definition: 'redirect WebDAV request on Master to Slaves', lazy: false), ]; }